Skip to content

Commit bb25398

Browse files
committed
feat(ci): close stale PRs automatically
relates to STACKITTPR-207
1 parent a137a04 commit bb25398

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Diff for: .github/workflows/stale.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
permissions:
16+
issues: write
17+
pull-requests: write
18+
19+
jobs:
20+
stale:
21+
name: "Stale"
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
steps:
25+
- name: "Mark old PRs as stale"
26+
uses: actions/stale@v9
27+
with:
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
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."
30+
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."
31+
days-before-pr-stale: ${{ env.DAYS_BEFORE_PR_STALE }}
32+
days-before-pr-close: ${{ env.DAYS_BEFORE_PR_CLOSE }}
33+
# never mark issues as stale or close them
34+
days-before-issue-stale: -1
35+
days-before-issue-close: -1

0 commit comments

Comments
 (0)