Require Dependabot actor for auto-run BrowserStack tests

Also gate the auto-run condition on github.actor == 'dependabot[bot]' so
commits pushed to a Dependabot PR by anyone else fall back to the explicit
safe_to_test opt-in instead of running automatically with secret access.
This commit is contained in:
zinduolis
2026-05-29 14:11:37 +10:00
parent be833faac3
commit 420681489c
+5 -1
View File
@@ -13,8 +13,12 @@ jobs:
group: browserstack-${{ github.event.pull_request.number }}
cancel-in-progress: true
# Auto-run for Dependabot; let humans opt in via the safe_to_test label.
# Require the triggering actor to also be Dependabot so commits pushed by
# anyone else fall back to the explicit safe_to_test opt-in.
if: >-
(github.event.pull_request.user.login == 'dependabot[bot]' && github.event.action != 'labeled') ||
(github.event.pull_request.user.login == 'dependabot[bot]' &&
github.actor == 'dependabot[bot]' &&
github.event.action != 'labeled') ||
github.event.label.name == 'safe_to_test'
env:
GITACTIONS: true