fix: improve bot detection and event filtering in GitHub workflow conditions

5fd64bef2e0f85e7fc1986c5e4469d584bda4589

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +8 -4Ignore whitespace
.github/workflows/issues-auto-manager.yml+1 -1
@@ -107,7 +107,7 @@ jobs:
107107 needs: [label-on-content, label-on-labels]
108108 runs-on: ubuntu-latest
109109 # Only run this on new comments, to automatically remove the stale label
110110 if: always() && (github.event_name == 'issue_comment' && github.actorevent.sender.type != 'github-actions[bot]Bot')
111111
112112 steps:
113113 - name: Mint App Token
.github/workflows/pr-auto-manager.yml+7 -3
@@ -169,7 +169,7 @@ jobs:
169169 needs: [label-by-branches, label-by-files]
170170 runs-on: ubuntu-latest
171171 # Only runs on comments not done by the github actions bot
172172 if: always() && (github.event_name == 'pull_request_review_comment' && github.actorevent.sender.type != 'github-actions[bot]Bot')
173173
174174 # Override permissions, issue labeler needs issues write access
175175 permissions:
@@ -257,7 +257,7 @@ jobs:
257257 needs: [label-by-branches, label-by-files, remove-stale-label, check-merge-blocking-labels]
258258 runs-on: ubuntu-latest
259259 # Run, even if the previous jobs were skipped/failed
260- if: always()
260+ if: always() && (github.event_name == 'pull_request_target')
261261
262262 steps:
263263 - name: Mint App Token
@@ -287,7 +287,11 @@ jobs:
287287 update-linked-issues:
288288 name: 🔗 Mark Linked Issues Done on Staging Merge
289289 runs-on: ubuntu-latest
290- if: always() && (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'staging')
290+ if: >
291+ always() &&
292+ github.event_name == 'pull_request_target' &&
293+ github.event.pull_request.merged == true &&
294+ github.event.pull_request.base.ref == 'staging'
291295
292296 # Override permissions, We need to be able to write to issues
293297 permissions: