Directly remove stale labels on comments
| @@ -1,17 +1,24 @@ | |||
| 1 | name: π― Close Stale Issues/PRs Workflow | 1 | name: π― Close Stale Issues/PRs Workflow |
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | # Run the workflow every day | ||
| 4 | workflow_dispatch: | 5 | workflow_dispatch: |
| 5 | schedule: | 6 | schedule: |
| 6 | - cron: '0 0 * * *' # Runs every day at midnight UTC | 7 | - cron: '0 0 * * *' # Runs every day at midnight UTC |
| 8 | # Re also listen to comment created events or new PR pushes, to remove stale labels right away | ||
| 7 | issue_comment: | 9 | issue_comment: |
| 8 | types: [created] | 10 | types: [created] |
| 9 | 11 | pull_request_review_comment: | |
| 12 | types: [created] | ||
| 13 | pull_request: | ||
| 14 | types: [synchronize] | ||
| 10 | 15 | ||
| 11 | jobs: | 16 | jobs: |
| 12 | mark-inactivity: | 17 | mark-inactivity: |
| 13 | name: Mark Issues/PRs without Activity | 18 | name: Mark Issues/PRs without Activity |
| 14 | runs-on: ubuntu-latest | 19 | runs-on: ubuntu-latest |
| 20 | # Only run this on the actual scheduled workflow | ||
| 21 | if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
| 15 | 22 | ||
| 16 | steps: | 23 | steps: |
| 17 | - name: Mark Issues/PRs without Activity | 24 | - name: Mark Issues/PRs without Activity |
| @@ -41,12 +48,13 @@ jobs: | |||
| 41 | close-pr-label: 'πΈοΈ Inactive' | 48 | close-pr-label: 'πΈοΈ Inactive' |
| 42 | exempt-issue-labels: 'π Keep Open' | 49 | exempt-issue-labels: 'π Keep Open' |
| 43 | exempt-pr-labels: 'π Keep Open' | 50 | exempt-pr-labels: 'π Keep Open' |
| 44 | labels-to-add-when-unstale: 'π Keep Open' | ||
| 45 | 51 | ||
| 46 | await-user-response: | 52 | await-user-response: |
| 47 | name: Mark Issues/PRs Awaiting User Response | 53 | name: Mark Issues/PRs Awaiting User Response |
| 48 | runs-on: ubuntu-latest | 54 | runs-on: ubuntu-latest |
| 49 | needs: mark-inactivity | 55 | needs: mark-inactivity |
| 56 | # Only run this on the actual scheduled workflow | ||
| 57 | if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
| 50 | 58 | ||
| 51 | steps: | 59 | steps: |
| 52 | - name: Mark Issues/PRs Awaiting User Response | 60 | - name: Mark Issues/PRs Awaiting User Response |
| @@ -74,6 +82,8 @@ jobs: | |||
| 74 | name: Mark Issues with Alternative Exists | 82 | name: Mark Issues with Alternative Exists |
| 75 | runs-on: ubuntu-latest | 83 | runs-on: ubuntu-latest |
| 76 | needs: await-user-response | 84 | needs: await-user-response |
| 85 | # Only run this on the actual scheduled workflow | ||
| 86 | if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | ||
| 77 | 87 | ||
| 78 | steps: | 88 | steps: |
| 79 | - name: Mark Issues with Alternative Exists | 89 | - name: Mark Issues with Alternative Exists |
| @@ -96,4 +106,19 @@ jobs: | |||
| 96 | stale-issue-label: 'π Awaiting User Response' | 106 | stale-issue-label: 'π Awaiting User Response' |
| 97 | close-issue-label: 'πΈοΈ Inactive' | 107 | close-issue-label: 'πΈοΈ Inactive' |
| 98 | exempt-issue-labels: 'π Keep Open' | 108 | exempt-issue-labels: 'π Keep Open' |
| 99 | labels-to-add-when-unstale: 'π Keep Open' | 109 | |
| 110 | remove-stale-label: | ||
| 111 | name: Remove Stale Label on Comment | ||
| 112 | runs-on: ubuntu-latest | ||
| 113 | # Only run this on new comments or PR commits, to automatically remove the stale label | ||
| 114 | if: (github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'pull_request') && github.actor != 'github-actions[bot]' | ||
| 115 | |||
| 116 | steps: | ||
| 117 | - name: Remove Stale Label | ||
| 118 | # π€ Issues Helper | ||
| 119 | # https://github.com/marketplace/actions/issues-helper | ||
| 120 | uses: actions-cool/issues-helper@v3 | ||
| 121 | with: | ||
| 122 | actions: 'remove-labels' | ||
| 123 | token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | ||
| 124 | labels: 'β°οΈ Stale,πΈοΈ Inactive,π Awaiting User Response,π No Response' | ||