Repository navigation
fix(security): verify the design-system publish tarball and pin the publish job's setup-node at v7.1.0 - #2447
Conversation
…ublish job's setup-node at v7.1.0 Follow-up to #2369 (design-system build/publish split), finishing #2421: - The Publish step took whatever pkg/*.tgz held and NPM_TOKEN covers the whole @concepttocloud scope. A credential-free gate now runs before the token step: exactly one tarball, its own package/package.json naming @concepttocloud/saiku-design-system at a strict-semver version equal to the version the build job reported; Publish then publishes exactly that verified tarball instead of the raw glob. - The publish job's setup-node was still pinned at the v7.0.0 SHA (the #2399 dependabot bump predates the split, and the split's rewrite reintroduced the old pin there); now pinned at the v7.1.0 SHA like the build job. - The version from the unprivileged build job still reaches the privileged scripts only through env — no run: script in the id-token: write job contains ${{ (now asserted by acceptance/2421). Maintainer action still required (repository settings, not code): create the npm-publish environment with required reviewers and move NPM_TOKEN into it. Hive-Run: #2421 Hive-Plan: issue-2421 design-system publish hardening Hive-Spec: acceptance/2421#C1-C4 Signed-off-by: spicule-hive-bot <spicule-hive-bot@users.noreply.github.com>
Semantic model diffNo semantic model changed in this pull request, so there was nothing to diff. |
6704ec0
|
CI feedbackpassing · Nothing to fix: every check in this commit concluded successfully. |
Signed-off-by: quality <334701613+spicule-hive[bot]@users.noreply.github.com>
|
Rework for the
Local verification: 🐝 Hive Agent: — hive: agent=quality backend=codex model=gpt-6-sol codex=0.167.0 |
PR acceptance metricAcceptance rate: 85.9% — 428 merged / 498 decided PRs (2 still open, excluded from the denominator).
Generated by |
Summary
Follow-up to #2369 (the design-system build/publish split), finishing #2421. Two of the issue's three points were already fixed by that merged PR; this PR closes the remaining two.
What was already done (by #2369, merged)
mkdir -p "$RUNNER_TEMP/pack"beforenpm pack— the ENOENT fix (issue item 1).env:; norun:script in theid-token: writejob contains${{(issue item 2).What this PR adds
Publishpreviously took whateverpkg/*.tgzheld, andNPM_TOKENcovers the whole@concepttocloudscope. A new credential-free step, "Verify the tarball is the design-system package", now refuses to proceed unless there is exactly one*.tgz, whose ownpackage/package.jsonnames@concepttocloud/saiku-design-systemat a strict-semver version equal to the version the build job reported.Publishthen publishes exactly that verified tarball (npm publish "$TARBALL") instead of the raw glob. A failure here never touches the registry token.82076278…): the build(deps): bump actions/setup-node from 7.0.0 to 7.1.0 #2399 dependabot bump to v7.1.0 predates the split, and the split's rewrite reintroduced the old pin in the new job. Now pinned at949feb2413d6458794dcd2491c4babbbce0c15c1(v7.1.0), same as the build job.acceptance/2421— a command spec (red on base, green here) asserting: no${{in anyrun:of theid-token: writejob (C1); the exactly-one/strict-name/strict-version gate and that Publish consumes the verified tarball rather than the glob (C2); the v7.1.0 pin (C3); andmkdir -p "$RUNNER_TEMP/pack"beforenpm pack(C4, regression guard for fix(security): split design-system build and publish jobs (#2335) #2369's ENOENT fix).Maintainer action still required (repository settings — not code, and outside a contributor's write scope)
npm-publishenvironment with required reviewers (and branch protection as desired) and moveNPM_TOKENinto it as an environment secret. The workflow already declaresenvironment: npm-publish; until the environment exists GitHub auto-creates it unprotected on first use. Also rotateNPM_TOKEN(it was exposed to a scripted publish before fix(security): split design-system build and publish jobs (#2335) #2369) — prefer a granular token limited to the@concepttocloud/saiku-design-systempackage, or enable npm Trusted Publishing and delete the token.Closes #2421
Test plan
acceptance/2421: red onupstream/development(C2 tarball gate, C3 pin), green on this branch (node .github/scripts/acceptance-runner.mjs run --dir acceptance/2421→ pass)node --test .github/scripts/*.test.mjs— 407 pass, 0 failpython3 -m unittest discover -s .github/scripts -p 'test_workflow_pins.py'— 8 passrun:block indesign-system.yml— no new findings beyond the pre-existing SC2148 shebang tip (all blocks) and an SC2153 info on the step-suppliedVERSIONenv, the same pattern the existing registry step uses— hive: backend=pi model=openrouter/z-ai/glm-5.3-flash
🐝 Hive Agent:
contributor| SHA:6704ec094