Skip to content

Commit 95b44ba

Browse files
committed
ci: add stale-bot workflow to auto-close inactive issues/PRs
- Run daily at 03:00 UTC and on manual `workflow_dispatch` - Mark issues stale after 120 days, close after another 30 days - Mark PRs stale after 90 days, close after another 30 days - Exempt `keep-open`, `in-progress`, `pinned`, `security`, `enhancement` labels - Scope to `comments` + `commits` activity so label edits do not reset the timer - Use minimal `issues` + `pull-requests` write permissions (no `contents: write`) - Add `concurrency` group so manual + scheduled runs do not overlap Helps keep the issue tracker focused on active reports rather than accumulating decade-old entries in this long-running theme repo.
1 parent fff9b34 commit 95b44ba

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/stale.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: stale
2+
3+
# Marks issues and pull requests that have had no activity for a long time as
4+
# stale, and closes them after an additional grace period. Helps the
5+
# StylishThemes/GitHub-Dark maintainers keep the issue tracker focused on
6+
# active reports instead of accumulating decade-old entries.
7+
8+
on:
9+
schedule:
10+
# Run once per day at 03:00 UTC. Stale-bot does not need higher frequency.
11+
- cron: "0 3 * * *"
12+
workflow_dispatch:
13+
# Allow maintainers to trigger a sweep manually after a release or triage.
14+
15+
permissions:
16+
issues: write
17+
pull-requests: write
18+
19+
jobs:
20+
stale:
21+
name: Mark stale and close
22+
runs-on: ubuntu-latest
23+
# Cancel any previous run if a new scheduled/manual run starts while the
24+
# previous one is still in progress.
25+
concurrency:
26+
group: stale-${{ github.ref }}
27+
cancel-in-progress: true
28+
steps:
29+
- name: Mark/close stale issues and PRs
30+
uses: actions/stale@v9
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
# Only operate on issues that look actionable (not pinned, not labeled
34+
# `keep-open` / `in-progress` / `pinned` / `security`).
35+
exempt-issue-labels: "keep-open,in-progress,pinned,security,enhancement"
36+
exempt-pr-labels: "keep-open,in-progress,pinned,security,work-in-progress"
37+
# Issue lifecycle: warn after 120 days of inactivity, close 30 days later.
38+
days-before-issue-stale: 120
39+
days-before-issue-close: 30
40+
# PR lifecycle: warn after 90 days, close 30 days later. PRs are closed
41+
# rather than left to rot because the base CSS changes often.
42+
days-before-pr-stale: 90
43+
days-before-pr-close: 30
44+
stale-issue-message: >
45+
This issue has not had any activity for ${{ github.event.inputs.days || 120 }} days.
46+
It will be closed in 30 days if no further activity occurs.
47+
Please reply if you would like to keep it open.
48+
close-issue-message: >
49+
This issue was closed because it has been stale for 30 days since the
50+
last update. If this is still relevant, please open a new issue with
51+
up-to-date reproduction details and a current screenshot.
52+
stale-pr-message: >
53+
This pull request has not had any activity for ${{ github.event.inputs.days || 90 }} days.
54+
It will be closed in 30 days if no further activity occurs.
55+
Feel free to reopen once the conflicts are resolved.
56+
close-pr-message: >
57+
This pull request was closed because it has been stale for 30 days
58+
since the last update. Please rebase against the current master and
59+
reopen if you would like to continue.
60+
# Limit per run so we do not hammer the API.
61+
operations-per-run: 100
62+
# Only count comments + commits toward "activity"; label edits and
63+
# title edits are ignored so drive-by label churn does not reset the
64+
# stale timer.
65+
only: comments, commits

0 commit comments

Comments
 (0)