Skip to content

Commit ee1f8f9

Browse files
chore(ci): add stale bot workflow for issue and PR management (kubernetes-sigs#642)
This workflow runs daily at 03:17 UTC and can be triggered manually. It: * Uses **actions/stale\@v9** to manage inactive issues and pull requests. * Labels issues/PRs as `stale` after **30 days of inactivity**, unless they carry the `keepalive` label. * Issues are **never auto-closed** (only marked stale). * PRs are **auto-closed after 60 days** of inactivity, with a notice that they can be reopened. * Maintainers get hygiene reminders via messages when items go stale. * Limits processing to 50 items per run and removes stale labels if activity resumes. Signed-off-by: Jakob Möller <[email protected]>
1 parent 12980e8 commit ee1f8f9

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/stale-bot.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# .github/workflows/stale.yml
2+
name: Stale Bot
3+
4+
on:
5+
schedule:
6+
# run daily at 03:17 UTC, to avoid clashing with a lot of other runs on Github CI
7+
- cron: '17 3 * * *'
8+
workflow_dispatch: # allow manual triggering
9+
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
stale:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Run stale action
19+
uses: actions/stale@v9
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
# General
24+
operations-per-run: 50
25+
remove-stale-when-updated: true
26+
enable-statistics: true
27+
28+
# Labels
29+
stale-issue-label: stale
30+
stale-pr-label: stale
31+
exempt-issue-labels: keepalive
32+
exempt-pr-labels: keepalive
33+
34+
# Timing
35+
days-before-issue-stale: 30
36+
# never auto-close issues
37+
days-before-issue-close: -1
38+
days-before-pr-stale: 30
39+
# auto close PRs after 60 days of inactivity.
40+
# Authors can simply reopen the PR when coming back to it.
41+
days-before-pr-close: 60
42+
43+
# Messaging
44+
stale-issue-message: >
45+
This issue has been marked **stale** due to 30 days of inactivity.
46+
Maintainers use this label for hygiene.
47+
Comment or add a relevant label (keepalive) to keep it from becoming stale.
48+
stale-pr-message: >
49+
This pull request has been marked **stale** due to 30 days of inactivity.
50+
Push changes, comment or add a relevant label (keepalive) to keep it from becoming stale.
51+
It will be closed in 30 days if no activity occurs.
52+
close-pr-message: >
53+
Closing this PR due to prolonged inactivity. Feel free to reopen or submit a new PR when coming back to it.
54+

0 commit comments

Comments
 (0)