Let OIDC supply the npm credential - #3
Merged
Merged
Conversation
setup-node's registry-url writes an .npmrc pinning _authToken to NODE_AUTH_TOKEN and exports the literal XXXXX-XXXXX-XXXXX-XXXXX placeholder when no secret is set. npm then sends that placeholder rather than falling back to the trusted publisher, and the registry rejects the PUT as a 404. Without registry-url no auth is configured, so the OIDC exchange runs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
v1.1.3publish run failed withE404 Not Found - PUT https://registry.npmjs.org/@concept7%2fkite, which is how the registry answers an unauthorized publish.Cause:
setup-node'sregistry-urlinput writes/home/runner/work/_temp/.npmrccontaining//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}and exportsNODE_AUTH_TOKENas its literal placeholderXXXXX-XXXXX-XXXXX-XXXXXwhen no secret is provided. npm found a configured credential, sent the placeholder, and never attempted the OIDC exchange with the trusted publisher.Removing
registry-urlleaves no auth configured, which is the condition for npm to fall back to trusted publishing. ThepublishConfig.registryinpackage.jsonalready targets npmjs, so nothing else needs it.Nothing was published from
v1.1.3, so that version is still free — but this needs a fresh tag to test, since the failed tag points at the commit without this fix.Test path
After merge, tag
v1.1.4on1.xand confirm the publish job succeeds, the version resolves on npmjs, and the release carries a provenance attestation.🤖 Generated with Claude Code