Skip to content

Commit 8efbf9b

Browse files
authored
ci: create stale workflow (#309)
Introduces a GitHub Actions workflow that automatically marks issues and pull requests as stale after 180 days of inactivity and closes them after an additional 60 days. This helps keep the repository clean and maintainable by prompting action on inactive items.
1 parent 7e473ef commit 8efbf9b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/stale.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow warns and then closes issues that have had no activity for a specified amount of time.
2+
# https://github.com/actions/stale
3+
4+
name: Stale
5+
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
# 00:00 UTC on Mondays
10+
- cron: '0 0 * * 1'
11+
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
16+
env:
17+
DAYS_BEFORE_STALE: 180
18+
DAYS_BEFORE_CLOSE: 60
19+
STALE_LABEL: 'stale'
20+
STALE_LABEL_URL: ${{github.server_url}}/${{github.repository}}/labels/stale
21+
22+
jobs:
23+
stale:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/stale@v10
27+
with:
28+
operations-per-run: 100
29+
days-before-stale: ${{ env.DAYS_BEFORE_STALE }}
30+
days-before-close: ${{ env.DAYS_BEFORE_CLOSE }}
31+
stale-issue-label: ${{ env.STALE_LABEL }}
32+
stale-pr-label: ${{ env.STALE_LABEL }}
33+
stale-issue-message: 'This issue has been marked ${{ env.STALE_LABEL_URL }} because it has been open for ${{ env.DAYS_BEFORE_STALE }} days with no activity. Please close this issue if it is no longer needed. If this issue is still relevant and you would like it to remain open, simply update it within the next ${{ env.DAYS_BEFORE_CLOSE }} days.'
34+
stale-pr-message: 'This pull request has been marked ${{ env.STALE_LABEL_URL }} because it has been open for ${{ env.DAYS_BEFORE_STALE }} days with no activity. Please close this pull request if it is no longer needed. If this pull request is still relevant and you would like it to remain open, simply update it within the next ${{ env.DAYS_BEFORE_CLOSE }} days.'

0 commit comments

Comments
 (0)