Skip to content

ci: Node and npm from org variables on both legs (shared-actions v3.0.0) - #22

Merged
robgilbreath merged 1 commit into
masterfrom
ci/toolchain-from-org-vars
Sep 3, 2026
Merged

robgilbreath merged 1 commit into
masterfrom
ci/toolchain-from-org-vars

Conversation

@robgilbreath

Copy link
Copy Markdown

Part of pncit/.github#23 — shared-actions v3.0.0 (pncit/shared-actions#34).

What changes

  • Workflows pass ${{ vars.NODE_VERSION }} / ${{ vars.NPM_VERSION }} (org Actions variables, currently 24.20.0 / 12.0.2) to validate-codebase, validate-build and deploy; a repo variable of the same name overrides the org one (canary).
  • Production Dockerfiles take them as build args: ARG NODE_VERSION → FROM node:${NODE_VERSION}-…, and every stage that runs npm ci does npm i -g "npm@${NPM_VERSION}" first. No defaults — deploy/validate-build always pass them.
  • .nvmrc deleted; the verify-node-toolchain step is gone (it read NODE_MAJOR_VERSION / NPM_MAJOR_VERSION, which no longer exist — that's why this repo's PR checks are currently red).
  • All shared-actions pins moved to v3.0.0 (8bc187e).

Why
CI has pinned npm 12.0.2 since shared-actions v2.2.0, but images were built with node:24-bookworm's bundled npm 11. The tested tree and the shipped image disagreed on exactly the dimension behind the allowScripts incident. Now one org variable moves both legs, and a Node/npm bump is a variable edit, not a 20-repo sweep.

Effect of merging

  • App repos: merge → Validate → Deploy rebuilds the production image on Node 24.20.0 / npm 12.0.2 and redeploys.
  • Libraries: no version bump, so no publish (.nvmrc and .github/** are exempt from the bump gate).

The workflows pass vars.NODE_VERSION / vars.NPM_VERSION to
validate-codebase, validate-build and deploy, and every Dockerfile takes
them as build args: `FROM node:${NODE_VERSION}-…` and
`npm i -g "npm@${NPM_VERSION}"` in each stage that runs `npm ci`. No
version literal remains in this repo — .nvmrc is gone, and so is the
top-level verify-node-toolchain step (it asserted the runner's system
node/npm, which nothing uses).

Why: CI has pinned npm 12.0.2 since shared-actions v2.2.0, but images
were built on node:24-bookworm's bundled npm 11. The tested tree and the
shipped image disagreed on the dimension that caused the allowScripts
incident. One org variable now moves both. pncit/.github#23
@robgilbreath
robgilbreath force-pushed the ci/toolchain-from-org-vars branch from 8ccb7f0 to c2afd3f Compare September 3, 2026 17:50
@robgilbreath
robgilbreath merged commit 2db4873 into master Sep 3, 2026
1 of 2 checks passed
@robgilbreath
robgilbreath deleted the ci/toolchain-from-org-vars branch September 3, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant