Skip to content

Commit 4708e2a

Browse files
authored
Add stale issue management (#451)
1 parent 59c382e commit 4708e2a

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/stale.yml

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

0 commit comments

Comments
 (0)