1+ name : Stale Issue Triage
2+
3+ on :
4+ push :
5+ branches : [ "stale-issues" ]
6+ paths :
7+ - ' .github/workflows/stale.yml'
8+ schedule :
9+ - cron : ' 20 8 * * 1'
10+ workflow_dispatch :
11+
12+ permissions :
13+ actions : read
14+ issues : read
15+ pull-requests : read
16+
17+ jobs :
18+ stale :
19+ name : Stale issue dry run
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Backlog snapshot
23+ env :
24+ GH_TOKEN : ${{ github.token }}
25+ REPOSITORY : ${{ github.repository }}
26+ run : |
27+ open_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open" --jq '.total_count')
28+ unmilestoned_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open no:milestone" --jq '.total_count')
29+ stale_issues=$(gh api -X GET search/issues -f q="repo:$REPOSITORY is:issue is:open label:stale" --jq '.total_count')
30+ 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')
31+
32+ {
33+ echo '## Stale issue triage snapshot'
34+ echo
35+ echo '| Query | Count |'
36+ echo '| --- | ---: |'
37+ echo "| Open issues | $open_issues |"
38+ echo "| Open unmilestoned issues | $unmilestoned_issues |"
39+ echo "| Open issues already labeled stale | $stale_issues |"
40+ echo "| Phase 1 dry-run candidates | $candidate_issues |"
41+ } >> "$GITHUB_STEP_SUMMARY"
42+
43+ - name : Run stale issue dry run
44+ uses : actions/stale@v10
45+ with :
46+ days-before-issue-stale : 365
47+ days-before-issue-close : -1
48+ days-before-pr-stale : -1
49+ days-before-pr-close : -1
50+ stale-issue-label : stale
51+ stale-issue-message : >
52+ This issue has not had recent activity. If it is still relevant,
53+ please leave a comment with any updated context so we can keep it in
54+ the active backlog. This initial rollout does not close issues
55+ automatically.
56+ exempt-all-issue-milestones : true
57+ exempt-issue-labels : ready-to-go, needs-further-study, important, waiting-for-something, bug
58+ remove-issue-stale-when-updated : true
59+ operations-per-run : 1000
60+ debug-only : true
61+ enable-statistics : true
0 commit comments