The workflow audit asks GitHub about a repository Forgejo never fetches from GitHub #77
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#77
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
The third and last reason CI was red, after #75 (the dependency audit) and #76 (two
platform-dependent tests).
Note the first line: no audit was performed. The step was not reporting a finding, it
was failing before it had looked at anything.
What is wrong
zizmor takes a GitHub API token from
--gh-token,GH_TOKENorGITHUB_TOKEN. ForgejoActions sets
GITHUB_TOKEN. So zizmor decided it was online, and asked github.com aboutactions/checkoutwhile holding a Forgejo token — which github.com rejected with 401.The token is the visible half. The other half is that the question was wrong to begin with:
Forgejo resolves a bare action name against its own instance, which the note at the top
of
ci.ymlalready says. What GitHub believesactions/checkout@v4refers to is not whatruns here, so the
ref-confusionaudit would have given a confident answer about the wronghost even with a token GitHub accepted.
And it passed on a laptop, every time, because with no token in the environment zizmor
defaults to offline and skips the online audits entirely. Same shape as #76: green only
where it was written.
The fix
Run
zizmor --offline. Not a concession — the mode that was always correct for a Forgejoinstance. The offline audits (injected expressions, over-broad permissions, unpinned
actions, and the rest) all still run; only the ones that would have questioned github.com
about a repository this CI never fetches from github.com are skipped.
Reproduced and verified locally rather than guessed:
The pattern across all three
#75, #76 and this one are the same fault wearing three coats: every check that passed
locally and failed in CI did so because it depended on something about the machine — an
editable install, a gitignored
.env, a platform's floating-point rounding, an injectedtoken. None of them was about the code.
They went unfound for thirty-eight runs because the CI logs are not reachable: this
Forgejo has no
actions/runs/{id}/jobsroute, noactions/jobs/{id}/logs, no artifactsendpoint, and the web UI's JSON returns
500: task ... does not existeven for runs thatsucceeded. All three were diagnosed from logs pasted in by hand. That is worth its own
issue against the instance's
ACTIONS.LOG_RETENTION_DAYSor log storage: a build whosefailures cannot be read is a build nobody reads.
Classification
Bug.