Stale Labeler and Closer #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stale labeler for PRs and issues | |
# This action will: | |
# * Add a label "stale" on issues and PRs after STALE_DAYS of inactivity and comment on them if they also have the "external" label | |
# * Close the stale issues and pull requests after 7 days of inactivity | |
# * If an update/comment occur on stale issues or pull requests, the stale label will be removed and the timer will restart if they have the "external" label | |
# Runs every morning at 1AM: We don't want people having to wait a whole week to get the stale label removed | |
# Docs: https://github.com/actions/stale | |
name: 'Stale Labeler and Closer' | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
workflow_dispatch: | |
jobs: | |
stale: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/stale@v9 | |
with: | |
days-before-issue-stale: ${{ env.ISSUE_STALE_DAYS }} | |
days-before-issue-close: ${{ env.ISSUE_CLOSE_AFTER_DAYS }} | |
days-before-pr-stale: -1 # With a negative number, this is currently turned off | |
days-before-pr-close: -1 # With a negative number, this is currently turned off | |
stale-issue-message: > | |
There has been no activity on this issue for ${{ env.ISSUE_STALE_DAYS }} days. | |
Labeling as stale and closing in ${{ env.ISSUE_CLOSE_AFTER_DAYS }} days if no further activity. | |
stale-pr-message: > | |
There has been no activity on this PR for ${{ env.PR_STALE_DAYS }} days. | |
Labeling as stale and closing in ${{ env.PR_CLOSE_AFTER_DAYS }} days if no further activity. | |
stale-issue-label: 'stale' | |
stale-pr-label: 'stale' | |
any-of-issue-labels: 'status/needinfo,priority/p2' # Only checks issues that have any of these labels | |
env: | |
ISSUE_STALE_DAYS: 60 | |
ISSUE_CLOSE_AFTER_DAYS: 7 | |
PR_STALE_DAYS: 60 | |
PR_CLOSE_AFTER_DAYS: 7 |