Repository navigation
fix(ci): scope npm auth to the fallback step, not the whole job - #258
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
🎉 This PR is included in version 2.9.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This branch was successfully deployed
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.
Description
Fixes a regression introduced by #257 (the git-notes fallback PR). That PR added
registry-url: https://registry.npmjs.orgto theSetup Node.jsstep so the new fallback step could authenticate npm viaNODE_AUTH_TOKEN. In practice,actions/setup-node'sregistry-urlinput exportsNPM_CONFIG_USERCONFIGfor the rest of the job, pointing every subsequent npm command at an.npmrcthat expects the token inNODE_AUTH_TOKEN- but the existingReleasestep only ever setNPM_TOKEN, which@semantic-release/npmhad been reading directly and successfully before that change. This broke the mainReleasestep's own npm authentication (observed asnpm error 401 Unauthorized/EINVALIDNPMTOKENon run38070320562, 2026-10-10), well before it could even reach the known git-notes issue the fallback was built for. TheDetect known git-notes push failurestep correctly recognized this as a different failure and refused to run the fallback, so nothing was silently papered over - it just surfaced a real, separate bug.Github Issue: None - found while testing #257's fallback with a real release run, not tracked by a filed issue.
Changes
.github/workflows/release.yml:registry-url: https://registry.npmjs.orgfrom theSetup Node.jsstep, restoring theReleasestep's original, working npm authentication (directNPM_TOKENread by@semantic-release/npm).Fallback publishstep's env var is renamed fromNODE_AUTH_TOKENback toNPM_TOKEN, and the step now runsnpm config set //registry.npmjs.org/:_authToken "${NPM_TOKEN}"itself before publishing - scoping the auth configuration to just that one step instead of exporting it job-wide.How Has This Been Tested?
workflow_dispatchworkflow isn't unit-testable.npx @action-validator/cli(passed). The regression itself was confirmed via the actual failed run (38070320562) that exposed it. The fix has not been exercised by an actual workflow run - there is no way to verify it without actually triggering a release.Checklist
Reviewer Guidance
gh workflow run release.yml. IfReleasefails on the known git-notes issue again, confirm theFallback publishstep runs and thatnpm publishsucceeds this time (not another 401), and that the new version appears on the npm registry (npm view arm-js-library version) and as a GitHub release.Releasestep's own npm authentication succeeds again (no 401 at theverifyConditionsstage), and if it still fails later on the known git-notes issue, the fallback publish completes successfully.