Skip to content

Commit e96c077

Browse files
authored
Merge a41128a into 1280729
2 parents 1280729 + a41128a commit e96c077

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: List Issues and Output as CSV
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '*/10 * * * *'
7+
issues:
8+
types: [opened, closed, reopened]
9+
pull_request:
10+
types: [opened, closed, reopened]
11+
12+
13+
jobs:
14+
list-issues:
15+
runs-on: ubuntu-latest
16+
steps:
17+
# Checkout the repo to access any scripts or tools you might need
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
# Generate issues CSV
22+
- name: Generate issues CSV
23+
run: |
24+
echo "Issue Number,Title,Labels" > issues.csv
25+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
26+
"https://api.github.com/repos/${{ github.repository }}/issues?state=all&per_page=100" | \
27+
jq -r '.[] | select(.pull_request == null) | [.number, .title, (.labels | map(.name) | join(","))] | @csv' >> issues.csv
28+
29+
#force add file to repo, commit and push
30+
- name: Commit and push
31+
run: |
32+
git config user.name "Automated"
33+
git config user.email "[email protected]"
34+
git add -f issues.csv
35+
timestamp=$(date -u)
36+
git commit -m "Latest data: ${timestamp}" || exit 0
37+
git push --force origin HEAD:refs/heads/n2020h-issues-to-csv
38+
39+
# # Upload CSV as artifact
40+
# - name: Upload CSV as artifact
41+
# uses: actions/upload-artifact@v2
42+
# with:
43+
# name: issues-csv
44+
# path: issues.csv
45+
46+
47+
# name: issues-csv
48+
# path: issues.csv

0 commit comments

Comments
 (0)