|
| 1 | +name: Mark Stale Issues and PRs |
| 2 | + |
| 3 | +# Keep the issue tracker and PR queue actionable by automatically aging |
| 4 | +# out items that have gone quiet. Items with no activity for 60 days are |
| 5 | +# labeled `stale` and warned; if they stay quiet for another 14 days they |
| 6 | +# are closed. ANY activity (comment, commit, label change, etc.) clears |
| 7 | +# the `stale` label and resets the clock, so this never closes something |
| 8 | +# people are still working on. |
| 9 | +# |
| 10 | +# Complements the other workflows in this directory (ci.yml builds/tests |
| 11 | +# PR code, pr-title-lint.yml validates PR title metadata): this one only |
| 12 | +# manages issue/PR *lifecycle*, never touches code. |
| 13 | +on: |
| 14 | + schedule: |
| 15 | + # Run once daily at 01:30 UTC. Off the top of the hour on purpose: |
| 16 | + # GitHub delays scheduled runs during the high-load :00 window, so an |
| 17 | + # odd minute starts more reliably and on time. |
| 18 | + - cron: "30 1 * * *" |
| 19 | + # Allow maintainers to trigger an on-demand sweep from the Actions tab |
| 20 | + # (e.g. after adjusting exempt labels) without waiting for the schedule. |
| 21 | + workflow_dispatch: |
| 22 | + |
| 23 | +# Cancel an in-flight scheduled sweep if a new one starts (e.g. a manual |
| 24 | +# dispatch overlapping the cron run). Stale processing is idempotent, so |
| 25 | +# superseding the older run avoids two passes mutating the same items. |
| 26 | +concurrency: |
| 27 | + group: stale-${{ github.workflow }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +# Principle of least privilege: actions/stale needs to write issues and |
| 31 | +# pull requests to apply labels, post comments, and close items. Nothing |
| 32 | +# else is required. |
| 33 | +permissions: |
| 34 | + contents: read |
| 35 | + issues: write |
| 36 | + pull-requests: write |
| 37 | + |
| 38 | +jobs: |
| 39 | + stale: |
| 40 | + name: Sweep stale issues and PRs |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: Mark and close stale items |
| 44 | + uses: actions/stale@v9.1.0 |
| 45 | + with: |
| 46 | + # --- Timing ------------------------------------------------- |
| 47 | + # 60 days of inactivity -> marked stale; 14 more days of |
| 48 | + # inactivity after that -> closed. (-1 would disable a phase.) |
| 49 | + days-before-stale: 60 |
| 50 | + days-before-close: 14 |
| 51 | + |
| 52 | + # --- Label applied to stale items --------------------------- |
| 53 | + stale-issue-label: stale |
| 54 | + stale-pr-label: stale |
| 55 | + |
| 56 | + # --- Comments posted when an item is marked stale ----------- |
| 57 | + # Posted at the 60-day mark so the author has 14 days to |
| 58 | + # respond before the item is closed. |
| 59 | + stale-issue-message: >- |
| 60 | + This issue has had no activity for 60 days and has been marked |
| 61 | + `stale`. It will be closed in 14 days if there is no further |
| 62 | + activity. To keep it open, leave a comment or remove the |
| 63 | + `stale` label. Thank you for your contributions! |
| 64 | + stale-pr-message: >- |
| 65 | + This pull request has had no activity for 60 days and has been |
| 66 | + marked `stale`. It will be closed in 14 days if there is no |
| 67 | + further activity. To keep it open, push a commit, leave a |
| 68 | + comment, or remove the `stale` label. Thank you for your |
| 69 | + contributions! |
| 70 | +
|
| 71 | + # --- Comments posted when an item is actually closed -------- |
| 72 | + close-issue-message: >- |
| 73 | + This issue was closed automatically because it remained `stale` |
| 74 | + for 14 days with no further activity. Please feel free to |
| 75 | + reopen it or open a new issue if this is still relevant. |
| 76 | + close-pr-message: >- |
| 77 | + This pull request was closed automatically because it remained |
| 78 | + `stale` for 14 days with no further activity. Please feel free |
| 79 | + to reopen it or open a new pull request if you wish to continue |
| 80 | + this work. |
| 81 | +
|
| 82 | + # --- Exemptions --------------------------------------------- |
| 83 | + # Items carrying any of these labels are never marked stale or |
| 84 | + # closed. `security` is listed explicitly so security reports |
| 85 | + # are never auto-closed (see Security Considerations in the |
| 86 | + # task). Applies to both issues and PRs. |
| 87 | + exempt-issue-labels: "pinned,security,epic" |
| 88 | + exempt-pr-labels: "pinned,security,epic" |
| 89 | + |
| 90 | + # --- Throughput / safety ------------------------------------ |
| 91 | + # Process newest items first so recently-aged items are handled |
| 92 | + # predictably across daily runs. |
| 93 | + ascending: false |
| 94 | + # Cap API operations per run to stay within rate limits on a |
| 95 | + # large backlog; remaining items are picked up the next day. |
| 96 | + operations-per-run: 200 |
0 commit comments