Skip to content

Commit e48c924

Browse files
committed
ci: mark and close PRs with formality issues
Add a recurring workflow that runs every day at 5:30 and marks all PRs that have formality check failures (i.e. marked as 'not following guidelines') that have not been active in the past 14 days as stale. Close stale PRs after 14 more days. Signed-off-by: George Sapkin <[email protected]>
1 parent bbaa539 commit e48c924

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/stale-bot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Mark and close stale issues and PRs
2+
3+
on:
4+
schedule:
5+
# Run once a day at 05:30
6+
- cron: '30 5 * * *'
7+
8+
permissions:
9+
actions: write
10+
# BUG: required due to an bug in the stale action:
11+
# https://github.com/actions/stale/issues/840#issuecomment-2195082494
12+
issues: read
13+
pull-requests: write
14+
15+
jobs:
16+
stale:
17+
runs-on: ubuntu-slim
18+
steps:
19+
- name: Mark and close PRs with formality issues
20+
uses: actions/stale@v10
21+
with:
22+
repo-token: ${{ secrets.GITHUB_TOKEN }}
23+
stale-pr-message: |
24+
This PR is stale because it has been open for 14 days with no activity and has the "not following guidelines" label.
25+
It will be closed if no further activity occurs within 14 days.
26+
close-pr-message: 'This PR was closed because it has been marked stale for 14 days with no activity.'
27+
days-before-stale: 14
28+
days-before-close: 14
29+
only-labels: 'not following guidelines'
30+
stale-pr-label: 'stale'

0 commit comments

Comments
 (0)