Commit 92771e2
ci: skip security scans gracefully when secrets are unavailable
The Snyk and SonarCloud workflows were failing on every run for
auth/config reasons, not code:
- Snyk hard-failed with 401 Unauthorized because no SNYK_TOKEN secret
is configured. Guard the scan on a job-level SNYK_TOKEN env so a
missing token skips the scan (with a "Snyk Unavailable" notice)
instead of failing the job.
- SonarCloud reported misleading green checks on Dependabot PRs (which
cannot access repository secrets, so the scan was silently skipped),
while pushes to main failed against an unauthorized token. Skip the
job entirely for Dependabot so PR checks no longer masquerade as
passing; pushes to main and normal PRs still run the real scan.
The scans themselves still require valid secrets to be configured
(see PR description).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7a09b85 commit 92771e2
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
0 commit comments