Skip to content

Commit 7e1cee9

Browse files
authored
chore: add stale workflow for issues and PRs (#116)
* chore: add stale workflow for issues and PRs * chore: remove unnecessary actions permission from stale workflow
1 parent e1ca536 commit 7e1cee9

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/stale.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 'Handle stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 9 * * 1-5'
5+
6+
permissions:
7+
contents: read
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
stale:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Check if holiday period
16+
id: holiday
17+
run: |
18+
# Skip during Christmas/New Year holidays (Dec 20 - Jan 3)
19+
MONTH=$(TZ=UTC date +%m)
20+
DAY=$(TZ=UTC date +%-d)
21+
if [[ "$MONTH" == "12" && $DAY -ge 20 ]] || [[ "$MONTH" == "01" && $DAY -le 3 ]]; then
22+
echo "skip=true" >> $GITHUB_OUTPUT
23+
echo "Skipping stale check during holiday period"
24+
else
25+
echo "skip=false" >> $GITHUB_OUTPUT
26+
fi
27+
28+
- uses: actions/stale@v10
29+
if: steps.holiday.outputs.skip != 'true'
30+
with:
31+
days-before-issue-stale: 730
32+
days-before-issue-close: 14
33+
stale-issue-message: "This issue hasn't seen activity in two years! If you want to keep it open, post a comment or remove the `stale` label – otherwise this will be closed in two weeks."
34+
close-issue-message: "This issue was closed due to lack of activity. Feel free to reopen if it's still relevant."
35+
stale-issue-label: stale
36+
remove-issue-stale-when-updated: true
37+
days-before-pr-stale: 7
38+
days-before-pr-close: 7
39+
stale-pr-message: "This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the `stale` label – otherwise this will be closed in another week."
40+
close-pr-message: "This PR was closed due to lack of activity. Feel free to reopen if it's still relevant."
41+
stale-pr-label: stale
42+
remove-pr-stale-when-updated: true
43+
operations-per-run: 250

0 commit comments

Comments
 (0)