Skip to content

fix(release): put npm auth in a user-level npmrc - #842

Merged
tutods merged 1 commit into
mainfrom
fix/release-npmrc-userconfig
Oct 27, 2026
Merged

tutods merged 1 commit into
mainfrom
fix/release-npmrc-userconfig

Conversation

@tutods

@tutods tutods commented Oct 27, 2026

Copy link
Copy Markdown
Owner

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 publish runs 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).

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.
@github-actions github-actions Bot added the fix label Oct 27, 2026
@tutods
tutods merged commit 3775e90 into main Oct 27, 2026
3 checks passed
@tutods
tutods deleted the fix/release-npmrc-userconfig branch October 27, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant