ci(scorecard): cure the 20/20 startup death and emit SARIF (#168) - #169
Merged
Merged
Conversation
Root cause, read from the run page of every failed run since 09-07: "The workflow is requesting 'actions: read, contents: read', but is only allowed 'actions: none, contents: none'." A job-level `permissions:` block REPLACES the workflow-level map, so the job that carried only `security-events: write` + `id-token: write` left the callee's `actions: read` / `contents: read` at `none`, and the runner refused the call at startup (jobs=0, startup_failure). #158 added the two scopes on 09-21 but nothing has exercised the file since: it runs only on `branch_protection_rule` and a weekly cron, with no dispatch. Cure, in the shape of the standards canonical caller: - workflow-level `permissions: contents: read`, job-level the four scopes the callee's jobs request (actions/contents read, security-events/id-token write); - triggers: push to main, pull_request, workflow_dispatch, plus the existing branch_protection_rule and '23 4 * * 1' cron; - concurrency group per ref, cancel-in-progress; - callee pinned to standards 0f13f51f, which emits `results_format: sarif` and uploads it (bd0df9ea emitted JSON and uploaded nothing, so a green run would still have produced no Scorecard analysis); - `secrets: inherit` dropped: the callee references no secrets. Lock key `.github/workflows/scorecard.yml: []` is unchanged; the callee's steps are not validated against the caller's lock (hypatia-scan is the control). `gh actions-lock --verify-local`: all 16 workflows covered. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYY8Gp4v4x2J7iSNn1vZ57
Contributor
|
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
.github/workflows/scorecard.ymlhas died at startup on every run since 2026-09-07 (startup_failure, jobs=0; #168 counts 20). This PR rewrites the caller in the shape of the standards canonical caller and pins the callee to a revision that actually uploads SARIF. Refs #168 — not closed here: its AC3 is a Scorecard analysis onmain, which only the post-mergepush: mainrun can produce.Root cause (read from the run page; the API carries no log for a jobs=0 run)
A job-level
permissions:block replaces the workflow-level map. The job carried onlysecurity-events: write+id-token: write, sopermissions: read-allat the workflow level did nothing for it, and the callee'sactions: read/contents: readwere refused at startup. #158 (a551037, 09-21) added the two scopes to the job block, but nothing has exercised the file since: it triggered only onbranch_protection_ruleand a weekly cron (23 4 * * 1, next 09-28) and had noworkflow_dispatch.Change
permissionsread-allcontents: read(standards shape)permissionsbranch_protection_rule, cronpush: main,pull_request,workflow_dispatch${{ github.workflow }}-${{ github.ref }}, cancel-in-progressbd0df9ea—results_format: json, no SARIF upload, so no analysis even when green0f13f51f—results_format: sarif+upload-sarif, PR lane in Local mode; green on standards push run 35794990055 and pull_request run 35795130513secrets: inheritsecrets.actions.lockkey'.github/workflows/scorecard.yml': []gh actions-lock --verify-local: 16/16 workflows coveredDeliberate differences from the standards caller: the cross-repo SHA pin, this repo's existing cron, and the
branch_protection_ruletrigger (kept, not mine to drop). The workflownameis unchanged so check-run history is not orphaned.Evidence (all three dispatched 2026-09-22T23:26:30Z)
fix/168-scorecard-caller6f01307 (this PR)Run Scorecardthen failed insideossf/scorecard-action:refs/heads/fix/168-scorecard-caller not supported with workflow_dispatch event. Only the default branch main is supported.The action refuses non-default branches by design; its supported lanes arepull_request(this PR's check) andpush: main(after merge).mutant/168-a-readall-two-scopes45f97fbread-all+ a job block of onlysecurity-events/id-token(the pre-#158 shape)startup_failure, jobs=0: "The nested job 'scorecard' is requesting 'actions: read, contents: read', but is only allowed 'actions: none, contents: none'." The diagnosed cause, reproduced one-variable.mutant/168-b-readall-four-scopes867847cread-all+ four job scopes (issue #168's own AC4 mutant)read-allalone was never the killer, #158's job block had already cured startup, and the AC4 mutant as written in the issue was the wrong shape.The mutant branches are deleted; the runs persist.
What the PR lane must show before this merges
scorecard / Run Scorecard PRgreen onrefs/pull/N/merge(Local mode,publish_results: false), and aScorecardentry undercode-scanning/analysesfor the PR ref.required_status_checks,code_scanning(CodeQL, Hypatia, Scorecard),required_signatures, review-thread resolution. Auto-merge by squash is armed only once every check is green (D87); nothing is merged over a red.push: mainrun produces theScorecardanalysis onmain(scorecard.yml has never run: 20/20 startup_failure (jobs=0); Scorecard is a required code_scanning tool with zero analyses #168 AC3), andworkflow_dispatchonmainworks (the action supports the default branch).🤖 Generated with Claude Code
https://claude.ai/code/session_01QYY8Gp4v4x2J7iSNn1vZ57