issue-daily #1003
This file contains hidden or 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: issue-daily | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| issues: write | |
| jobs: | |
| issue-close-need-reproduction: | |
| name: close need-reproduction issues | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Close inactive need-reproduction issues | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| set -euo pipefail | |
| cutoff="$(date -u -d '7 days ago' '+%Y-%m-%d')" | |
| query="repo:${GH_REPO} is:issue is:open label:\"need reproduction\" updated:<${cutoff}" | |
| gh api --method GET --paginate /search/issues -f q="${query}" -f per_page=100 --jq '.items[].number' | | |
| while read -r issue_number; do | |
| gh issue close "${issue_number}" --repo "${GH_REPO}" | |
| done |