Skip to content

Commit 17e8175

Browse files
committed
feat(ci): close stale PRs automatically
relates to STACKITTPR-207
1 parent 69e408c commit 17e8175

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/stale.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Stale"
2+
on:
3+
schedule:
4+
# every night at 01:30
5+
- cron: "30 1 * * *"
6+
# run this workflow if the workflow definition gets changed within a PR
7+
pull_request:
8+
branches: ["main"]
9+
paths: [".github/workflows/stale.yaml"]
10+
11+
env:
12+
DAYS_BEFORE_PR_STALE: 7
13+
DAYS_BEFORE_PR_CLOSE: 7
14+
15+
jobs:
16+
stale:
17+
name: "Stale"
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
steps:
21+
- name: "Mark old PRs as stale"
22+
uses: actions/stale@v9
23+
with:
24+
repo-token: ${{ secrets.CLI_RELEASE }}
25+
stale-pr-message: "This PR was marked as stale after ${{ env.DAYS_BEFORE_PR_STALE }} days of inactivity and will be closed after another ${{ env.DAYS_BEFORE_PR_CLOSE }} days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it."
26+
close-pr-message: "This PR was closed automatically because it has been stalled for ${{ env.DAYS_BEFORE_PR_CLOSE }} days with no activity. Feel free to re-open it at any time."
27+
days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }}
28+
days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }}
29+
# never mark issues as stale or close them
30+
days-before-issue-stale: -1
31+
days-before-issue-close: -1

0 commit comments

Comments
 (0)