Repository navigation
Commit fdb27bf
committed
fix: skip SARIF upload on a private repository instead of failing
zizmor-action and codeql-action/analyze both upload their SARIF to
GitHub code scanning, which needs GitHub Advanced Security — absent on
a private repository, so both jobs failed with a 403 on every run of
the walkthrough's own recommended `--private` setup, for a reason that
has nothing to do with the code being scanned.
zizmor: advanced-security: false plus annotations: true reports the
same findings as workflow annotations instead of a SARIF upload.
zizmor's own exit code still fails the job on a real finding either
way, so this is applied unconditionally rather than gated on
visibility — no downside on a public repo, and no need to detect which
one this is (github.event.repository.private is absent on a schedule
trigger, one of this workflow's own triggers).
codeql: CodeQL has no local pass/fail — the Advanced Security upload is
the only signal its action produces, so gating it needs to know the
repository's real visibility. Read via `gh api repos/<owner>/<repo>`,
which works under every trigger including schedule. upload: never on a
private repo keeps the database build and query run, just skips the
call that gets rejected — a private repo gets no code-scanning signal
here, same tradeoff as gitleaks and zizmor's exit code can't stand in
for. A public repo keeps the full Security-tab upload, which GitHub
does not require Advanced Security for.
Claude-Session: https://claude.ai/code/session_01J4HB8qJjdZwaAv42k6HMpv1 parent 3483552 commit fdb27bf
1 file changed
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
39 | 53 | | |
40 | 54 | | |
| 55 | + | |
| 56 | + | |
41 | 57 | | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
46 | | - | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
50 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
51 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
0 commit comments