Skip to content

Commit de1c782

Browse files
committed
Automatically marks inactive PRs / issues as stale and close
1 parent 1d96454 commit de1c782

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Automation to mark issues and pull requests stale
2+
#
3+
# REFERENCES
4+
#
5+
# https://github.com/step-security/harden-runner
6+
# https://github.com/actions/stale
7+
#
8+
# The following automations will occur:
9+
#
10+
# - Stale label is added to issues and pull requests after 365 days of inactivity
11+
# - Close stale issues and pull requests after 7 days of inactivity (365 + 7 days total inactivity)
12+
# - Remove stale label and restart timer if an update/comment occurs
13+
14+
name: Automate stale issues
15+
on:
16+
workflow_dispatch:
17+
schedule:
18+
- cron: '*/30 * * * *' # run every 30 minutes as it handles label removal
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
stale:
25+
permissions:
26+
issues: write # for actions/stale to close stale issues
27+
pull-requests: write # for actions/stale to close stale PRs
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
32+
with:
33+
egress-policy: audit
34+
35+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
36+
id: stale
37+
with:
38+
stale-issue-message: >
39+
This issue has been automatically marked as stale because it has not had any
40+
activity for 90 days. It will be closed if no further activity occurs. Thank
41+
you for your contributions.
42+
days-before-issue-stale: 365
43+
days-before-issue-close: 7
44+
# exempt-issue-labels: "type: idea"
45+
stale-issue-label: stale
46+
stale-pr-message: >
47+
This PR has been automatically marked as stale because it has not had any
48+
recent activity from the author for 30 days. It will be closed if no further
49+
activity occurs. If the PR was closed and you want it re-opened, please let
50+
us know and we'll re-open the PR.
51+
days-before-pr-stale: 365
52+
days-before-pr-close: 7
53+
# exempt-pr-labels: tech-debt
54+
stale-pr-label: stale
55+
operations-per-run: 100

0 commit comments

Comments
 (0)