Skip to content

Commit

Permalink
Update issues-to-csv to add more fields.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
n2020h authored Jul 22, 2024
1 parent 0963a4e commit f491475
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/issues-to-csv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

# Generate issues CSV
# - name: Generate issues CSV
# run: |
# echo "Issue Number,Title,Labels" > issues.csv
# curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# "https://api.github.com/repos/${{ github.repository }}/issues?state=all&per_page=100" | \
# jq -r '.[] | select(.pull_request == null) | [.number, .title, (.labels | map(.name) | join(","))] | @csv' >> issues.csv

# Generate issues CSV
- name: Generate issues CSV
run: |
echo "Issue Number,Title,Labels" > issues.csv
echo "Issue Number,Title,Labels,State,Assignee,Milestone,Comments,Created At,Updated At,Closed At,Author Association,Body" > issues.csv
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=all&per_page=100" | \
jq -r '.[] | select(.pull_request == null) | [.number, .title, (.labels | map(.name) | join(","))] | @csv' >> issues.csv
jq -r '.[] | select(.pull_request == null) | [.number, .title, (.labels | map(.name) | join(",")), .state, (.assignee | if . != null then .login else "None" end), (.milestone | if . != null then .title else "None" end), .comments, .created_at, .updated_at, (.closed_at // "None"), .author_association, .body] | @csv' >> issues.csv
#force add file to repo, commit and push
- name: Commit and push
run: |
Expand Down

0 comments on commit f491475

Please sign in to comment.