Repository navigation
feat(release): take an optional node-version input for every job that sets up Node - #115
Merged
Merged
Conversation
… sets up Node release.yml set Node up on fixed lines: 22 in the version job, 24 in the release and finalize jobs. A package whose engines.node starts above 22 has its version job refused by pnpm at pnpm install --frozen-lockfile (ERR_PNPM_UNSUPPORTED_ENGINE) on every push to main, with no way to ask for another line. The new node-version input defaults to empty, which keeps each job on the line it ran on before, so no caller changes. A value applies to all three jobs. It must be a version of Node 24 or later, because the release job publishes on it, and the version job refuses anything else before it sets Node up, installs, tags or publishes. The input reaches setup-node and one env entry only, never shell text. Claude-Session: https://claude.ai/code/session_016orFiR8mq7oCYo77QDTw2U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
release.ymltakes an optionalnode-versioninput: the Node line every job that sets up Node runs on, which isversion,releaseandfinalize. Each job'sactions/setup-nodereads${{ inputs.node-version || '<the line it ran on before>' }}: 22 inversion, 24 inreleaseandfinalize. A new step in theversionjob,The node-version input must be 24 or later, refuses any value that is not a version of Node 24 or later, before setup-node, the install, the tag or the publish. The input reaches setup-node and oneenv:entry only, never shell text. CHANGELOG.md's Unreleased section and the README caller example say how a caller uses it.Why
A package whose
engines.nodestarts above 22 has itsversionjob refused by pnpm atpnpm install --frozen-lockfile(ERR_PNPM_UNSUPPORTED_ENGINE) on every push to its main, because that job set up Node 22 with no input to change it. With this, such a caller passeswith: { node-version: "24" }and installs, builds and publishes on 24 in all three jobs.The value is held to 24 or later because the
releasejob publishes on it, and the npm every Node 22 release bundles is below the publish floor (the rule that keeps thereleasejob on Node 24 or later). Checking in theversionjob stops the run before anything is tagged;releaseandfinalizeboth needversion, so neither runs on a refused value.Proof
test/release-node-version.test.mjs, on the shared workflow reader: the input is optional with an empty default; every job that sets up Node does so once, from the input, falling back to its old line; the check runs unconditionally and precedes setup-node,pnpm installandrelease-tag.mjs;releaseandfinalizeneedversion; the input appears only in the three setup-node lines and the one env entry. It also runs the check's own script with bash: empty,24,24.18.0,24.x,v24,v26.1,26,30.0.0pass;22,22.14.0,v22,23.11.1,8,lts/*,node,latest,>=24,24,24; true,24.1.2.3are refused."24"fails two tests; the check's floor lowered to 22 fails one.test/environment-gate.test.mjsAC11 lists the new input and pins its type and empty default; AC10 records the new suite as reading the workflow through the shared reader.node --test "test/*.test.mjs"1208 of 1208 pass;check-no-emdash.mjsOK;package-lists.mjsOK.Choices
node-versionstring input, the same name and shape thegate-*workflows took in the last reference, rather than reading anode-versionslist asci.yml's prepublish does:release.ymlhas nonode-versionsinput, and adding a list only to read its first entry would be a second spelling of one setting."22"(thegate-*default), because the three jobs ran on two different lines and one literal default would have movedreleaseandfinalizeoff 24. Empty keeps each job exactly where it was, so no caller has to act.versiononly, so one input means one line for the whole run, and thereleasejob can never be handed a Node whose npm is below the publish floor. Aliases such aslts/*and ranges such as>=24are refused too, because what they resolve to is not fixed;publish-floor.mjsstill checks the real npm at publish time.ci.ymlis not touched.Kind: code
https://claude.ai/code/session_016orFiR8mq7oCYo77QDTw2U