Add stale issue triage dry run workflow #2
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: Stale Issue Triage | |
| on: | |
| push: | |
| branches: [ "stale-issues" ] | |
| paths: | |
| - '.github/workflows/stale.yml' | |
| schedule: | |
| - cron: '20 8 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| issues: read | |
| pull-requests: read | |
| jobs: | |
| stale: | |
| name: Stale issue dry run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Backlog snapshot | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REPOSITORY: ${{ github.repository }} | |
| run: | | |
| open_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open" --jq '.total_count') | |
| unmilestoned_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open no:milestone" --jq '.total_count') | |
| stale_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open label:stale" --jq '.total_count') | |
| candidate_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open no:milestone -label:ready-to-go -label:needs-further-study -label:important -label:waiting-for-something -label:bug" --jq '.total_count') | |
| { | |
| echo '## Stale issue triage snapshot' | |
| echo | |
| echo '| Query | Count |' | |
| echo '| --- | ---: |' | |
| echo "| Open issues | $open_issues |" | |
| echo "| Open unmilestoned issues | $unmilestoned_issues |" | |
| echo "| Open issues already labeled stale | $stale_issues |" | |
| echo "| Phase 1 dry-run candidates | $candidate_issues |" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Run stale issue dry run | |
| uses: actions/stale@v10 | |
| with: | |
| days-before-issue-stale: 365 | |
| days-before-issue-close: -1 | |
| days-before-pr-stale: -1 | |
| days-before-pr-close: -1 | |
| stale-issue-label: stale | |
| stale-issue-message: > | |
| This issue has not had recent activity. If it is still relevant, | |
| please leave a comment with any updated context so we can keep it in | |
| the active backlog. This initial rollout does not close issues | |
| automatically. | |
| exempt-all-issue-milestones: true | |
| exempt-issue-labels: ready-to-go, needs-further-study, important, waiting-for-something, bug | |
| remove-issue-stale-when-updated: true | |
| operations-per-run: 1000 | |
| debug-only: true | |
| enable-statistics: true |