Skip to content

N2020h issues to csv #11

N2020h issues to csv

N2020h issues to csv #11

Workflow file for this run

name: List Issues and Output as CSV
on:
workflow_dispatch:
schedule:
- cron: '*/10 * * * *'
issues:
types: [opened, closed, reopened]
pull_request:
types: [opened, closed, reopened]
jobs:
list-issues:
runs-on: ubuntu-latest
steps:
# Checkout the repo to access any scripts or tools you might need
- 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
#force add file to repo, commit and push
- name: Commit and push
run: |
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -f issues.csv
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push --force origin HEAD:refs/heads/n2020h-issues-to-csv
# # Upload CSV as artifact
# - name: Upload CSV as artifact
# uses: actions/upload-artifact@v2
# with:
# name: issues-csv
# path: issues.csv
# name: issues-csv
# path: issues.csv