|
| 1 | +# This workflow automatically marks issues and pull requests as stale after 90 days of inactivity |
| 2 | +# and closes them after an additional 30 days if no further activity occurs. |
| 3 | +# |
| 4 | +# Key behavior: |
| 5 | +# - After 90 days of no activity: |
| 6 | +# - Open issues and pull requests are labeled with "lifecycle/stale" |
| 7 | +# - A comment is posted to notify contributors about the inactivity |
| 8 | +# |
| 9 | +# - After 30 additional days (i.e., 120 days total): |
| 10 | +# - If still inactive and still labeled "lifecycle/stale", the issue or PR is closed |
| 11 | +# - A closing comment is posted to explain why it was closed |
| 12 | +# |
| 13 | +# - Activity such as a comment, commit, or label removal during the stale period |
| 14 | +# will remove the "lifecycle/stale" label and reset the clock |
| 15 | +# |
| 16 | +# - Items with any of the following labels will never be marked stale or closed: |
| 17 | +# - security |
| 18 | +# - planned |
| 19 | +# - priority/critical |
| 20 | +# - lifecycle/frozen |
| 21 | +# - verified |
| 22 | +# |
| 23 | +# This workflow uses: https://github.com/actions/stale |
| 24 | +name: "Close stale issues and PRs" |
| 25 | +on: |
| 26 | + schedule: |
| 27 | + - cron: "0 1 * * *" # Runs daily at 01:00 UTC (adjust as needed) |
| 28 | + |
| 29 | +jobs: |
| 30 | + stale: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + permissions: |
| 33 | + issues: write # allow labeling, commenting, closing issues |
| 34 | + pull-requests: write # allow labeling, commenting, closing PRs |
| 35 | + steps: |
| 36 | + - uses: actions/stale@v9 |
| 37 | + with: |
| 38 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + days-before-stale: 90 |
| 40 | + days-before-close: 30 |
| 41 | + stale-issue-label: "lifecycle/stale" |
| 42 | + stale-pr-label: "lifecycle/stale" |
| 43 | + stale-issue-message: > |
| 44 | + Issues go stale after 90 days of inactivity. If there is no further |
| 45 | + activity, the issue will be closed in another 30 days. |
| 46 | + stale-pr-message: > |
| 47 | + PRs go stale after 90 days of inactivity. If there is no further |
| 48 | + activity, the PR will be closed in another 30 days. |
| 49 | + close-issue-message: "This issue has been closed due to inactivity." |
| 50 | + close-pr-message: "This pull request has been closed due to inactivity." |
| 51 | + exempt-issue-labels: "security,planned,priority/critical,lifecycle/frozen,verified" |
| 52 | + exempt-pr-labels: "security,planned,priority/critical,lifecycle/frozen,verified" |
| 53 | + operations-per-run: 30 |
0 commit comments