Skip to content

Commit 9a5ffbf

Browse files
[OPS] Add GitHub Action to clean-up stale PRs (#1038)
* Add GitHub Action to clean-up stale PRs * Add token to workflow
1 parent 8eb8dfb commit 9a5ffbf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/stale.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Close Stale PRs"
2+
3+
on:
4+
schedule:
5+
- cron: '30 1 * * *' # every day at 1:30 AM
6+
workflow_dispatch:
7+
8+
permissions:
9+
pull-requests: write
10+
issues: write
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@v9
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
days-before-stale: 35 # 5 working weeks should be ok
20+
days-before-close: 14 # plus 2 weeks to act
21+
stale-pr-label: 'stale'
22+
stale-pr-message: 'This PR is stale because it has been open 35 days with no activity. Remove "stale" label or comment or this will be closed in 14 days.'
23+
close-pr-message: 'This PR was closed because it has been stalled for 14 days with no activity.'

0 commit comments

Comments
 (0)