Commit 2dbed8b
authored
fix(ci): grant Scorecard's called workflow contents:read (last startup_failure) (#294)
Two independent fixes, both **measured on `main`** after #293 landed.
## 1 · `Scorecards supply-chain security` — the last `startup_failure`
Re-pinning `scorecard-reusable` in #293 did **not** fix it. That is the
useful result: it proves the stale pin was never the cause.
The real cause is the caller's permission block:
```yaml
jobs:
analysis:
permissions:
security-events: write
id-token: write # <- `contents` omitted
```
Declaring `permissions:` at **job** level sets every *unlisted* scope to
`none`, and a called workflow can never hold more than the calling job
grants it. `scorecard-reusable` declares top-level `permissions:
contents: read` and its first step is `actions/checkout` — so it was
being handed **`contents: none`**. The call died at startup with zero
jobs, which is exactly why there is no log to read and why it looked
inscrutable.
**Confirmed against the green sibling.** `boj-server-cartridges`'
`scorecard.yml` lists all three — `contents: read`, `security-events:
write`, `id-token: write` — and its runs succeed. This one omitted the
first.
This is root cause **(A)** of the estate's two `startup_failure` shapes
— *reusable permission escalation* — and is unrelated to BROKEN-M1,
which was the other.
## 2 · Revert `pages.yml` / `pages-deploy.yml` checkout to the v4 SHA
#293 pinned these to `de0fac2e` (v6.0.2). On reflection that shipped an
unvalidated version change:
- Both workflows are **`push: [main]`-only** — no `pull_request` — so no
PR can exercise them. The bump's first execution is on `main`.
- `pages.yml` is this repo's **only container job** (`idris2-pack`) and
has **never completed a run**. checkout v6 requires node24 injected into
the container; whether that works against this image is precisely what
could not be observed.
`11d5960a` is exactly what `actions/checkout@v4` resolves to today, so
this is a **pure pin** — the linter only requires a full-length SHA, not
a particular version. A considered v4 → v6 bump belongs in a change
where it can be watched.
## Verification
- 0 of 94 `uses:` unpinned (scanning **both** the bare and `- uses:`
forms — the latter is invisible to the standards linter)
- all three files parse as YAML
## State of `main` after #293
`Governance` is **SUCCESS** — all 9 jobs green, the two that were red
are fixed. Remaining red on `main`:
| Check | Cause | Fixed by |
|---|---|---|
| `Scorecards supply-chain security` | `contents: none` to the called
workflow | **this PR** |
| `deploy` (Cloudflare) | `CLOUDFLARE_API_TOKEN` /
`CLOUDFLARE_ACCOUNT_ID` **absent from repo secrets** — confirmed in the
log: *"necessary to set a CLOUDFLARE_API_TOKEN environment variable"* |
needs a human: add secrets or retire the workflow |
| `SonarQube` | `SONAR_TOKEN` exists but `HTTP 403`; the SonarCloud
project itself is fine (badge endpoint 200), so the token is
expired/wrong-scope | needs a human: regenerate in SonarCloud |
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent a74d33d commit 2dbed8b
3 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
0 commit comments