Skip to content

Commit 21ff5db

Browse files
authored
ci(stale): add stale issue and PR workflow (#1890)
* ci(stale): add stale issue and PR workflow Signed-off-by: Taylor Mutch <taylormutch@gmail.com> * fix: remove draft-pr from exemption --------- Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
1 parent fb83d1a commit 21ff5db

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/stale.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "17 8 * * *"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
stale:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
issues: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
19+
with:
20+
stale-issue-label: state:stale
21+
stale-pr-label: state:stale
22+
23+
days-before-issue-stale: 14
24+
days-before-issue-close: -1 # -1 puts this into dry-run mode. Update to 7 to enable closing.
25+
days-before-pr-stale: 14
26+
days-before-pr-close: -1 # -1 puts this into dry-run mode. Update to 7 to enable closing.
27+
28+
exempt-issue-labels: state:triage-needed,roadmap
29+
close-issue-reason: not_planned
30+
31+
stale-issue-message: >
32+
This issue has had no activity for 14 days and is now marked stale.
33+
It may be closed in 7 days if there is no further activity.
34+
Comment or remove the state:stale label to keep it open.
35+
close-issue-message: >
36+
Closing this issue after 7 days with no activity since it was marked stale.
37+
Reopen it if the work is still relevant.
38+
stale-pr-message: >
39+
This pull request has had no activity for 14 days and is now marked stale.
40+
It may be closed in 7 days if there is no further activity.
41+
close-pr-message: >
42+
Closing this pull request after 7 days with no activity since it was marked stale.

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Skills connect into pipelines. Individual skill files don't describe these relat
9494

9595
Workflow state labels use the `state:*` prefix, and security work uses `topic:security`. GitHub issue templates assign built-in issue types where applicable, and agent-created issues should use issue types or manual follow-up rather than type labels.
9696
New issues opened by users without `write`, `maintain`, or `admin` repository permission are automatically labeled `state:triage-needed` by the issue triage workflow.
97+
Inactive issues and pull requests are automatically labeled `state:stale` after 14 days without activity and may be closed after 7 more days without activity. Comment on the item or remove `state:stale` to keep it open. Issues labeled `state:triage-needed` or `roadmap` are exempt from stale handling.
9798

9899
## Prerequisites
99100

0 commit comments

Comments
 (0)