Skip to content

Commit dd87b48

Browse files
ci(scorecard): cure the 20/20 startup death and emit SARIF (#168) (#169)
## What `.github/workflows/scorecard.yml` has 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 on `main`, which only the post-merge `push: main` run can produce. ## Root cause (read from the run page; the API carries no log for a jobs=0 run) > The workflow is not valid. .github/workflows/scorecard.yml (Line: 15, Col: 3): Error calling workflow 'hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@bd0df9ea…'. 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. The job carried only `security-events: write` + `id-token: write`, so `permissions: read-all` at the workflow level did nothing for it, and the callee's `actions: read` / `contents: read` were 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 on `branch_protection_rule` and a weekly cron (`23 4 * * 1`, next 09-28) and had no `workflow_dispatch`. ## Change | | before (main 828399a) | after | |---|---|---| | workflow `permissions` | `read-all` | `contents: read` (standards shape) | | job `permissions` | four scopes (since #158) | four scopes (unchanged) | | triggers | `branch_protection_rule`, cron | + `push: main`, `pull_request`, `workflow_dispatch` | | concurrency | none | `${{ github.workflow }}-${{ github.ref }}`, cancel-in-progress | | callee pin | standards `bd0df9ea` — `results_format: json`, no SARIF upload, so no analysis even when green | standards `0f13f51f` — `results_format: sarif` + `upload-sarif`, PR lane in Local mode; green on standards push run 35794990055 and pull_request run 35795130513 | | `secrets: inherit` | yes | dropped — the callee references no `secrets.` | | `actions.lock` key | `'.github/workflows/scorecard.yml': []` | unchanged; a callee's steps are not validated against the caller's lock (hypatia-scan is the control). `gh actions-lock --verify-local`: 16/16 workflows covered | Deliberate differences from the standards caller: the cross-repo SHA pin, this repo's existing cron, and the `branch_protection_rule` trigger (kept, not mine to drop). The workflow `name` is unchanged so check-run history is not orphaned. ## Evidence (all three dispatched 2026-09-22T23:26:30Z) | branch | shape | run | result | |---|---|---|---| | `fix/168-scorecard-caller` 6f01307 (this PR) | cure | 35797429801 | **passed startup**, jobs=2. `Run Scorecard` then failed inside `ossf/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 are `pull_request` (this PR's check) and `push: main` (after merge). | | `mutant/168-a-readall-two-scopes` 45f97fb | `read-all` + a job block of only `security-events`/`id-token` (the pre-#158 shape) | 35797435300 | **`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-scopes` 867847c | `read-all` + four job scopes (issue #168's own AC4 mutant) | 35797440576 | **passed startup**, then the same in-action refusal as the cure. So `read-all` alone 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 PR` green on `refs/pull/N/merge` (Local mode, `publish_results: false`), and a `Scorecard` entry under `code-scanning/analyses` for the PR ref. - Every rule of ruleset 18110203 passing: `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. - After merge: the `push: main` run produces the `Scorecard` analysis on `main` (#168 AC3), and `workflow_dispatch` on `main` works (the action supports the default branch). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QYY8Gp4v4x2J7iSNn1vZ57 Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 828399a commit dd87b48

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

‎.github/workflows/scorecard.yml‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
11
# This workflow is managed by gh actions-lock.
22
# SPDX-License-Identifier: MPL-2.0
3-
# This workflow is managed by gh actions-lock.
4-
# This workflow is managed by gh actions-lock.
3+
# Thin wrapper around hyperpolymath/standards scorecard-reusable.yml, in the
4+
# shape of the standards caller (standards/.github/workflows/scorecard.yml).
5+
# Deliberate differences from that caller: the cross-repo SHA pin, this repo's
6+
# existing weekly cron, and the branch_protection_rule trigger. See #168.
7+
58
name: Scorecards supply-chain security
69

710
on:
11+
push:
12+
branches: [main]
13+
pull_request:
814
branch_protection_rule:
915
schedule:
1016
- cron: '23 4 * * 1'
17+
workflow_dispatch:
18+
19+
# Estate guardrail: cancel superseded runs so re-pushes don't pile up.
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
1123

12-
permissions: read-all
24+
# A job-level `permissions:` block REPLACES the workflow-level map, so the
25+
# calling job below must itself grant every scope the callee's jobs request:
26+
# actions: read (Scorecard's Packaging check), contents: read (checkout),
27+
# security-events: write (SARIF upload), id-token: write (OIDC publication).
28+
# This file died at startup 20/20 times while the job block carried only
29+
# security-events + id-token, which left actions and contents at `none` (#168).
30+
permissions:
31+
contents: read
1332

1433
jobs:
15-
analysis:
34+
scorecard:
1635
permissions:
1736
actions: read
1837
contents: read
1938
security-events: write
2039
id-token: write
21-
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@bd0df9ead7faf0cdfe0e13e7966d91e28d0101d4
22-
secrets: inherit
40+
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@0f13f51fafe9d2b670252aa2a18993223bffdece

0 commit comments

Comments
 (0)