fix(ci): set NODE_AUTH_TOKEN for npm publish with setup-node registry-url#28
Merged
Conversation
7 tasks
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.
Summary
actions/setup-nodewithregistry-urlwrites npm auth to${RUNNER_TEMP}/.npmrcand setsNPM_CONFIG_USERCONFIGso all npm commands use that file. The token line uses${NODE_AUTH_TOKEN}. IfNODE_AUTH_TOKENis unset, setup-node exports a placeholder value (XXXXX-XXXXX-XXXXX-XXXXX), sonpm publishnever uses the realNPM_TOKENthatchangesets/actionadds to~/.npmrc—which npm ignores in this configuration.This PR sets
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}at the job level on the Release workflow so publish uses the same secret as the temp userconfig.Type of Change
Merge Strategy Reminder
develop: Use "Squash and merge" ✅main: Use "Create a merge commit" ✅ (NOT squash merge)Squash merging to
maincan cause conflicts when mergingdevelop→mainlater.Checklist
Testing
actions/setup-nodeauth behavior (NODE_AUTH_TOKENplaceholder when unset).develop/main, confirm the next Release run shows a real maskedNODE_AUTH_TOKENin logs (not the literalXXXXX-...placeholder) and npm publish succeeds.Related Issues
N/A (npm publish
E404on scoped package due to auth not reaching registry).