Directly remove stale labels on comments

ecaee2dbbf145e2da92667970177df2e1ef0a8ce

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +28 -3Showing whitespace changes
.github/workflows/job-close-stale.yml+28 -3
@@ -1,17 +1,24 @@
11name: 🎯 Close Stale Issues/PRs Workflow
22
33on:
4+ # Run the workflow every day
45 workflow_dispatch:
56 schedule:
67 - 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
79 issue_comment:
810 types: [created]
9-
11+ pull_request_review_comment:
12+ types: [created]
13+ pull_request:
14+ types: [synchronize]
1015
1116jobs:
1217 mark-inactivity:
1318 name: Mark Issues/PRs without Activity
1419 runs-on: ubuntu-latest
20+ # Only run this on the actual scheduled workflow
21+ if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
1522
1623 steps:
1724 - name: Mark Issues/PRs without Activity
@@ -41,12 +48,13 @@ jobs:
4148 close-pr-label: 'πŸ•ΈοΈ Inactive'
4249 exempt-issue-labels: 'πŸ“Œ Keep Open'
4350 exempt-pr-labels: 'πŸ“Œ Keep Open'
44- labels-to-add-when-unstale: 'πŸ“Œ Keep Open'
4551
4652 await-user-response:
4753 name: Mark Issues/PRs Awaiting User Response
4854 runs-on: ubuntu-latest
4955 needs: mark-inactivity
56+ # Only run this on the actual scheduled workflow
57+ if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
5058
5159 steps:
5260 - name: Mark Issues/PRs Awaiting User Response
@@ -74,6 +82,8 @@ jobs:
7482 name: Mark Issues with Alternative Exists
7583 runs-on: ubuntu-latest
7684 needs: await-user-response
85+ # Only run this on the actual scheduled workflow
86+ if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
7787
7888 steps:
7989 - name: Mark Issues with Alternative Exists
@@ -96,4 +106,19 @@ jobs:
96106 stale-issue-label: '🚏 Awaiting User Response'
97107 close-issue-label: 'πŸ•ΈοΈ Inactive'
98108 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'