fix: write GitHub Packages auth to NPM_CONFIG_USERCONFIG not ~/.npmrc#37
Merged
raphaelmansuy merged 1 commit intomainfrom Apr 13, 2026
Merged
fix: write GitHub Packages auth to NPM_CONFIG_USERCONFIG not ~/.npmrc#37raphaelmansuy merged 1 commit intomainfrom
raphaelmansuy merged 1 commit intomainfrom
Conversation
actions/setup-node sets NPM_CONFIG_USERCONFIG to a temp file; appending the @raphaelmansuy scope and GitHub Packages token to ~/.npmrc was being ignored, causing ENEEDAUTH on every GitHub Packages publish 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.
Root cause
actions/setup-nodesetsNPM_CONFIG_USERCONFIGto a temp file (e.g./home/runner/work/_temp/.npmrc). The GitHub Packages publish step was appending the scoped registry and auth token to~/.npmrc, which npm never reads — causingENEEDAUTHon every run.Fix
Use
${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}as the target so npm actually picks up the token.Verified diagnosis from CI run 24354302693
The npm publish step correctly skipped (already published), but GitHub Packages failed every attempt due to missing auth.