fix: set up Node via .nvmrc before running semantic-release - #535
Draft
joris974 wants to merge 1 commit into
Draft
fix: set up Node via .nvmrc before running semantic-release#535joris974 wants to merge 1 commit into
joris974 wants to merge 1 commit into
Conversation
cycjimmy/semantic-release-action runs as a plain Node.js action (runs.using: node24), not a container action, so it executes directly on the runner using whatever Node/Yarn are already on PATH. Without a setup-node step, the exec plugin's `yarn install && yarn run build` runs against the runner's ambient Node instead of the version pinned in .nvmrc, unlike ci.yml which sets this up correctly. Add the same actions/setup-node@v7 step used in ci.yml before the semantic-release-action step.
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.
The gap
.github/workflows/release.ymlnever sets up Node/Yarn before invokingcycjimmy/semantic-release-action@v6.0.0.Why it matters
cycjimmy/semantic-release-action'saction.ymldeclares:(verified via
gh api repos/cycjimmy/semantic-release-action/contents/action.yml)That's a plain Node.js action, not a Docker container action — it executes directly on the
ubuntu-latestrunner's own filesystem/toolchain, using whatevernode/yarnalready happen to be onPATH. It does not bring its own isolated Node version.This repo's
.releaserc.yamlincludes an@semantic-release/execstep withprepareCmd: "yarn install && yarn run build", which runs inside the semantic-release-action process. Since that action runs on the runner's ambient Node rather than an isolated one, this build command executes against whatever Node version happens to be preinstalled on the runner image — not the version pinned in this repo's.nvmrc.Compare to
.github/workflows/ci.yml, which correctly sets up Node before running any yarn commands:release.ymlhas no equivalent step, so a release build could silently use a different Node version than CI (and than whatyarn.lock/enginesexpect) — risking inconsistentdist/index.jsoutput between CI and release, or outright build failures if the runner's default Node version ever drifts from what this project needs.This is the same category of gap a Freckle reviewer flagged on the sibling
cancelable-promise-jssemantic-release PR (freckle/cancelable-promise-js#152): needing to set up the package manager/runtime before the semantic-release action runs its build command, since that action runs directly on the runner rather than in an isolated container.The fix
Add an
actions/setup-node@v7step, mirroringci.yml, after checkout and before thecycjimmy/semantic-release-actionstep.Not changed
.releaserc.yaml— no changes needed.if: false # remove this when you are ready to release your actionguard on the job — left in place; this is a template repo with no real action published yet, so the guard remains correct.Test plan
if: falseguard is removed, confirm the release job buildsdist/index.jsusing the.nvmrc-pinned Node version (verify via anode --versionecho or by diffing dist output against a local build)🤖 Generated with Claude Code