Repository navigation
fix(release): put npm auth in a user-level npmrc - #842
Merged
Merged
Conversation
npm publish runs inside each package directory, where npm treats that directory as the project and ignores the repo-root .npmrc, so the NPM_ACCESS_TOKEN line never reached it (ENEEDAUTH on the pull_request_target release run). Write the registry and auth to $RUNNER_TEMP/.npmrc and point NPM_CONFIG_USERCONFIG at it.
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 release run from merging #841 failed with ENEEDAUTH for @tutods/components 0.9.8 and @tutods/renovate-config 0.0.8, although NODE_AUTH_TOKEN was set.
Cause:
npm publishruns inside each package directory; npm treats that directory as the project root and ignores the repo-root .npmrc where the auth line was appended (verified locally: a root .npmrc setting is not read from a package dir, a NPM_CONFIG_USERCONFIG file is). The earlier successful publish must have authenticated via OIDC.Fix: write registry + auth to $RUNNER_TEMP/.npmrc and export NPM_CONFIG_USERCONFIG via GITHUB_ENV. Provenance is unchanged (id-token: write).