Test run for closing community metrics issues #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Community Metrics | |
on: | |
push: | |
permissions: | |
issues: write | |
pull-requests: read | |
jobs: | |
generate-community-metrics: | |
name: Generate Community Metrics | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close Previous Issue | |
shell: pwsh | |
run: | | |
# Without the --repo switch, the GH CLI will try to look it up from the current clone, which doesn't exist | |
# because we don't otherwise need checkout. | |
$issues = gh issue list --repo '${{ github.repository }}' --label 'community metrics' --state open --json number --jq '.[].number' | |
foreach ($issue in $issues) | |
{ | |
gh issue close $issue --repo '${{ github.repository }}' --comment 'Closing this issue as newer community metrics are available.' | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |