1- name : " Close stale issues "
1+ name : " Stale Issue Management "
22on :
33 schedule :
4- - cron : " 0 0 * * *"
4+ # Run daily at midnight UTC
5+ - cron : " 0 0 * * *"
6+ workflow_dispatch : # Allow manual triggering
7+
8+ env :
9+ # Default stale policy timeframes
10+ DAYS_BEFORE_STALE : 365
11+ DAYS_BEFORE_CLOSE : 30
12+
13+ # Accelerated timeline for needs-information issues
14+ NEEDS_INFO_DAYS_BEFORE_STALE : 30
15+ NEEDS_INFO_DAYS_BEFORE_CLOSE : 7
516
6- permissions : {}
717jobs :
818 stale :
9- permissions :
10- issues : write # to close stale issues (actions/stale)
11- pull-requests : write # to close stale PRs (actions/stale)
12-
1319 runs-on : ubuntu-latest
1420 steps :
15- - uses : actions/stale@v9
16- with :
17- repo-token : ${{ secrets.GITHUB_TOKEN }}
18- stale-issue-message : ' This issue is marked stale. It will be closed in 30 days if it is not updated.'
19- stale-pr-message : ' This pull request is marked stale. It will be closed in 30 days if it is not updated.'
20- days-before-stale : 365
21- days-before-close : 30
22- stale-issue-label : " Stale"
23- stale-pr-label : " Stale"
24- operations-per-run : 10
25- remove-stale-when-updated : true
21+ # First step: Handle regular issues (excluding needs-information)
22+ - name : Mark regular issues as stale
23+ uses : actions/stale@v9
24+ with :
25+ repo-token : ${{ secrets.GITHUB_TOKEN }}
26+ debug-only : true
27+
28+ # Default stale policy
29+ days-before-stale : ${{ env.DAYS_BEFORE_STALE }}
30+ days-before-close : ${{ env.DAYS_BEFORE_CLOSE }}
31+
32+ # Explicit stale label configuration
33+ stale-issue-label : " stale"
34+ stale-pr-label : " stale"
35+
36+ stale-issue-message : |
37+ This issue has been automatically marked as stale due to inactivity.
38+ It will be closed in 30 days if no further activity occurs.
39+ If you believe this issue is still relevant, please add a comment to keep it open.
40+
41+ close-issue-message : |
42+ This issue has been automatically closed due to inactivity.
43+ If you believe this issue is still relevant, please reopen it or create a new issue with updated information.
44+
45+ # Exclude needs-information issues from this step
46+ exempt-issue-labels : ' no-stale,needs-information'
47+
48+ # Remove stale label when issue/PR becomes active again
49+ remove-stale-when-updated : true
50+
51+ # Apply to pull requests with same timeline
52+ days-before-pr-stale : ${{ env.DAYS_BEFORE_STALE }}
53+ days-before-pr-close : ${{ env.DAYS_BEFORE_CLOSE }}
54+
55+ stale-pr-message : |
56+ This pull request has been automatically marked as stale due to inactivity.
57+ It will be closed in 30 days if no further activity occurs.
58+
59+ close-pr-message : |
60+ This pull request has been automatically closed due to inactivity.
61+ If you would like to continue this work, please reopen the PR or create a new one.
62+
63+ # Only exclude no-stale PRs (needs-information PRs follow standard timeline)
64+ exempt-pr-labels : ' no-stale'
65+
66+ # Second step: Handle needs-information issues with accelerated timeline
67+ - name : Mark needs-information issues as stale
68+ uses : actions/stale@v9
69+ with :
70+ repo-token : ${{ secrets.GITHUB_TOKEN }}
71+ debug-only : true
72+
73+ # Accelerated timeline for needs-information
74+ days-before-stale : ${{ env.NEEDS_INFO_DAYS_BEFORE_STALE }}
75+ days-before-close : ${{ env.NEEDS_INFO_DAYS_BEFORE_CLOSE }}
76+
77+ # Explicit stale label configuration
78+ stale-issue-label : " stale"
79+
80+ # Only target ISSUES with needs-information label (not PRs)
81+ only-issue-labels : ' needs-information'
82+
83+ stale-issue-message : |
84+ This issue has been marked as stale because it requires additional information
85+ that has not been provided for 30 days. It will be closed in 7 days if the
86+ requested information is not provided.
87+
88+ close-issue-message : |
89+ This issue has been closed because the requested information was not provided within the specified timeframe.
90+ If you can provide the missing information, please reopen this issue or create a new one.
91+
92+ # Disable PR processing for this step
93+ days-before-pr-stale : -1
94+ days-before-pr-close : -1
95+
96+ # Remove stale label when issue becomes active again
97+ remove-stale-when-updated : true
0 commit comments