Skip to content

Commit 7add7bc

Browse files
committed
fix(ci): grant scorecard's called workflow contents:read; revert unproven checkout bump
Two independent CI fixes, both measured on main after #293. 1. `Scorecards supply-chain security` -- the last startup_failure Re-pinning scorecard-reusable in #293 did NOT fix it, which proves the pin was never the cause. Root cause is the caller's permission block: 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 why there is no log to read. 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. Adding `contents: read` here. This is root cause (A) from the estate's two startup_failure shapes -- reusable permission escalation -- not BROKEN-M1. 2. Revert pages.yml/pages-deploy.yml checkout to the v4 SHA #293 pinned these to de0fac2e (v6.0.2). Both workflows are `push: [main]`-only, so no PR could exercise them, and pages.yml is this repo's only container job (idris2-pack) and has never completed a run -- checkout v6 needs node24 injected into the container, which 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. Verified: 0 of 94 `uses:` unpinned; all three files parse as YAML.
1 parent a74d33d commit 7add7bc

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/pages-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
deploy:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2222
- name: Deploy site/ to Cloudflare Workers (static assets)
2323
run: npx wrangler@latest deploy
2424
env:

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
image: ghcr.io/stefan-hoeck/idris2-pack@sha256:f0758996a931fb35d9ecb1de273c4d59dabe2a09b433afc7e357f65a08b7e1ff
2424
steps:
2525
- name: Checkout Site
26-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2727
- name: Checkout Ddraig SSG
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2929
with:
3030
repository: hyperpolymath/ddraig-ssg
3131
path: .ddraig-ssg

.github/workflows/scorecard.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ permissions:
3131
jobs:
3232
analysis:
3333
permissions:
34+
# `contents: read` is REQUIRED, not redundant. Declaring `permissions:`
35+
# at job level sets every unlisted scope to `none`, and a called
36+
# workflow can never hold more than the calling job grants it. The
37+
# reusable declares top-level `permissions: contents: read` and its
38+
# first step is actions/checkout, so omitting `contents` here handed
39+
# it `contents: none` and the call died at startup with zero jobs.
40+
# The green sibling (boj-server-cartridges) lists all three.
41+
contents: read
3442
security-events: write
3543
id-token: write
3644
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@8813ecf2a841335c9dc14c75cc46694722cd6d28

0 commit comments

Comments
 (0)