Skip to content

Commit 4333cc6

Browse files
committed
infra: Autoclose stale PRs
Close PRs older than 30 days. Signed-off-by: Nicolae Dicu <[email protected]>
1 parent 3ada66e commit 4333cc6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/docs-cleanup.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,33 @@ jobs:
2424
permissions:
2525
pages: write
2626
contents: write
27+
pull-requests: write
2728
steps:
29+
- name: Close abandoned PRs
30+
uses: actions/stale@v9
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
# days-before-stale Idle number of days before marking issues/PRs stale (default: 60)
35+
# days-before-close Idle number of days before closing stale issues/PRs (default: 7)
36+
37+
# Don't handle issues
38+
# If set to a negative number like -1, the issues or the pull requests will never be closed automatically.
39+
days-before-issue-stale: -1 # Override days-before-stale for issues only
40+
days-before-issue-close: -1 # Override days-before-close for issues only
41+
42+
# Handle PRs
43+
# Mark as stale after 30 days of inactivity and then for stale PRs close immediately
44+
days-before-pr-stale: 30 # Override days-before-stale for PRs only
45+
days-before-pr-close: 0 # Override days-before-close for PRs only
46+
close-pr-label: autoclose # Label the PR as autoclosed
47+
48+
# Add comment to the PR when it is closed
49+
close-pr-message: "Auto-closing: no activity for 30 days. If this is still relevant, reopen or create a fresh PR."
50+
51+
# Drafts dont create docs so leave them alone
52+
exempt-draft-pr: true
53+
2854
- name: Checkout gh-pages branch
2955
uses: actions/checkout@v4
3056
with:

0 commit comments

Comments
 (0)