|
1 |
| -name: Mark stale issues and auto close if inactive |
| 1 | +name: Manage Stale, Legacy, and Close Issues |
2 | 2 |
|
3 | 3 | on:
|
4 |
| -# schedule: |
5 |
| -# - cron: "30 1 * * *" |
6 |
| - |
7 |
| -# debugging |
8 |
| - workflow_dispatch: |
| 4 | + # Uncomment the schedule below to run automatically, or trigger manually with workflow_dispatch. |
| 5 | + # schedule: |
| 6 | + # - cron: '0 4 * * *' # 04:00 UTC |
| 7 | + # - cron: '30 5 * * *' # 05:30 UTC |
| 8 | + |
| 9 | + workflow_dispatch: |
9 | 10 |
|
10 | 11 | jobs:
|
11 |
| - stale: |
12 |
| - |
| 12 | + # ---------------------------------------------------------------------------- |
| 13 | + # Job: stale-issues |
| 14 | + # Summary: |
| 15 | + # Marks open issues as "stale" if they have had no activity for 1 year (365 days), |
| 16 | + # and then closes issues that remain stale for 30 days, |
| 17 | + # unless they carry exempt labels such as "pinned", "security", or "keep-alive". |
| 18 | + # ---------------------------------------------------------------------------- |
| 19 | + stale-issues: |
13 | 20 | runs-on: ubuntu-latest
|
14 | 21 | permissions:
|
15 | 22 | issues: write
|
| 23 | + steps: |
| 24 | + - name: Manage stale issues |
| 25 | + uses: actions/stale@v9 |
| 26 | + with: |
| 27 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + days-before-issue-stale: 365 |
| 29 | + days-before-pr-stale: -1 |
| 30 | + days-before-issue-close: 30 |
| 31 | + days-before-pr-close: -1 |
| 32 | + stale-issue-label: 'stale' |
| 33 | + close-issue-label: 'auto-closed' |
| 34 | + stale-issue-message: > |
| 35 | + This issue has been inactive for over a year and has been marked as stale. |
| 36 | + It will be automatically closed in 30 days if no further activity occurs. |
| 37 | + Since significant changes have occurred in the codebase, please open a new issue |
| 38 | + with updated details if the problem still persists. |
| 39 | + close-issue-message: > |
| 40 | + This issue is being automatically closed due to prolonged inactivity. |
| 41 | + If you believe this issue is still relevant, please open a new issue with updated details. |
| 42 | + exempt-issue-labels: 'pinned,security,keep-alive' |
| 43 | + debug-only: false |
| 44 | + enable-statistics: true |
| 45 | + remove-stale-when-updated: true |
| 46 | + operations-per-run: 500 |
16 | 47 |
|
| 48 | + # ---------------------------------------------------------------------------- |
| 49 | + # Job: mark-legacy-issue |
| 50 | + # Summary: |
| 51 | + # Marks open issues as "legacy" (using ignore-updates so that only the creation date is considered) |
| 52 | + # if they were created over 2 years (730 days) ago and lack exempt labels like "pinned" or "security". |
| 53 | + # ---------------------------------------------------------------------------- |
| 54 | + mark-legacy-issue: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + permissions: |
| 57 | + issues: write |
17 | 58 | steps:
|
18 |
| - - uses: actions/stale@v3 |
19 |
| - with: |
20 |
| - repo-token: ${{ secrets.GITHUB_TOKEN }} |
21 |
| - |
22 |
| - stale-issue-label: 'stale' |
23 |
| - stale-issue-message: 'This issue is marked stale because it has not seen any activity in 365 days. Please let us know if this is still an important issue for you, otherwise it will be automatically closed in 10 days to help us focus on more active issues. Thanks.' |
24 |
| - close-issue-message: 'This issue was closed because it has been stalled for over 365 days without any activity.' |
25 |
| - days-before-issue-stale: 365 |
26 |
| - days-before-issue-close: 10 |
27 |
| - |
28 |
| - operations-per-run: 500 |
29 |
| - |
30 |
| - # debugging |
31 |
| - debug-only: true |
32 |
| - enable-statistics: true |
33 |
| - |
34 |
| - |
35 |
| - |
| 59 | + - name: Mark legacy issues using stale action |
| 60 | + uses: actions/stale@v9 |
| 61 | + with: |
| 62 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + ignore-updates: true |
| 64 | + days-before-issue-stale: 730 |
| 65 | + days-before-pr-stale: -1 |
| 66 | + days-before-issue-close: -1 |
| 67 | + days-before-pr-close: -1 |
| 68 | + stale-issue-label: 'legacy' |
| 69 | + stale-issue-message: > |
| 70 | + This issue was created over 2 years ago and is considered legacy. |
| 71 | + Given the extensive changes to the codebase since then, we recommend opening a new issue |
| 72 | + with updated details if this problem still affects you. |
| 73 | + exempt-issue-labels: 'pinned,security' |
| 74 | + debug-only: false |
| 75 | + enable-statistics: true |
| 76 | + remove-stale-when-updated: false |
| 77 | + operations-per-run: 500 |
| 78 | + |
0 commit comments