Skip to content

Commit bd84f27

Browse files
wolpertclaude
andcommitted
ci: skip SonarQube and Stryker on Dependabot PRs (secrets withheld)
GitHub withholds repository secrets from Dependabot-triggered workflow runs, so the SonarQube scan (SONAR_TOKEN) and Stryker dashboard reporter (STRYKER_DASHBOARD_API_KEY) hard-fail on every Dependabot PR — the browser-mutation job went red on #64 and #65. The existing guard only excluded fork PRs, but Dependabot branches live in the same repo, so they slipped through. Exclude `github.actor == 'dependabot[bot]'` from both steps. The vitest suite still runs (so any future npm-dependency Dependabot PR is still gated on tests), and mutation-testing a dependency bump added no signal anyway. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b8854f9 commit bd84f27

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,21 @@ jobs:
8181
- name: SonarQube scan
8282
# JavaScript/browser-SDK static analysis only. SonarQube was dropped for the JVM modules
8383
# (ADR 0018, native JaCoCo gates) but retained here for the TypeScript SDK.
84-
# SONAR_TOKEN is unavailable to PRs from forks; skip there to avoid a hard failure.
85-
# Manual (workflow_dispatch) and push runs always have the secret available.
86-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
84+
# Needs SONAR_TOKEN, which GitHub withholds from fork PRs AND from Dependabot-triggered
85+
# runs — skip in both cases so the scan doesn't hard-fail without a token. Manual
86+
# (workflow_dispatch) and push runs always have the secret available.
87+
if: github.actor != 'dependabot[bot]' && (github.event_name == 'workflow_dispatch' || github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
8788
uses: sonarsource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0
8889
env:
8990
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
9091
with:
9192
projectBaseDir: clients/passkeys-browser
9293

9394
- name: Run Stryker mutation tests
95+
# Skip on Dependabot PRs: the dashboard reporter needs STRYKER_DASHBOARD_API_KEY, which is
96+
# withheld from Dependabot-triggered runs, and mutation testing a dependency bump adds no
97+
# signal. The vitest suite above still runs and gates the PR.
98+
if: github.actor != 'dependabot[bot]'
9499
run: npm exec --no-install -- stryker run
95100
working-directory: clients/passkeys-browser
96101
env:

0 commit comments

Comments
 (0)