Skip to content

Commit c479974

Browse files
ci(workflows): add stale issue closure workflow
1 parent f34f4e9 commit c479974

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/stale-issues.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Close Stale Issues
2+
3+
# Run daily at 00:00 UTC to check for stale issues
4+
on:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
# Allow manual triggering for testing
8+
workflow_dispatch:
9+
10+
# Minimal permissions for security
11+
permissions:
12+
issues: write
13+
14+
jobs:
15+
stale:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Close stale issues
20+
uses: actions/stale@v9
21+
with:
22+
# Repository token for authentication
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
# === Issue Configuration ===
26+
27+
# Days of inactivity before an issue becomes stale
28+
days-before-stale: 30
29+
30+
# Days of inactivity before a stale issue is closed
31+
days-before-close: 7
32+
33+
# Message to post when marking an issue as stale
34+
stale-issue-message: >
35+
This issue has been automatically marked as stale because it has not had
36+
any activity for 30 days. It will be closed in 7 days if no further
37+
activity occurs. If you believe this issue is still relevant, please leave
38+
a comment to keep it open. Thank you for your contributions!
39+
40+
# Message to post when closing a stale issue
41+
close-issue-message: >
42+
This issue has been automatically closed due to inactivity. If you believe
43+
this issue should be reopened, please feel free to do so with a comment
44+
explaining why it should be reopened. Thank you!
45+
46+
# Label to apply when an issue becomes stale
47+
stale-issue-label: 'stale'
48+
49+
# Don't close issues that have assignees
50+
exempt-all-assignees: true
51+
52+
# Don't close issues that are part of a milestone
53+
exempt-all-milestones: true
54+
55+
# === Pull Request Configuration ===
56+
57+
# Disable automatic closure of stale PRs
58+
# PRs often need more time and manual review
59+
days-before-pr-stale: -1
60+
days-before-pr-close: -1
61+
62+
# === Additional Options ===
63+
64+
# Maximum number of operations per run (helps avoid rate limits)
65+
operations-per-run: 100
66+
67+
# Remove stale label when an issue is updated
68+
remove-stale-when-updated: true
69+
70+
# Process issues in ascending order (oldest first)
71+
ascending: true
72+
73+
# Enable debug output for troubleshooting
74+
debug-only: false

0 commit comments

Comments
 (0)