Repository navigation
feat: fix npm OIDC publishing by using @semantic-release/exec - #8
Merged
Merged
Conversation
prepublishOnly triggers vp run build which spawns a child process that loses the OIDC auth token. The build already runs explicitly in the workflow, so lifecycle scripts are redundant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@semantic-release/npm verifies OIDC works but doesn't pass --provenance to npm publish. Setting NPM_CONFIG_PROVENANCE=true tells npm to handle OIDC auth directly during publish. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The npm trusted publishing OIDC flow requires the registry URL to be configured via actions/setup-node. This creates the .npmrc that enables npm to perform OIDC token exchange during publish. Per npm docs, no --provenance flag or NPM_TOKEN is needed when trusted publishing is configured — npm handles auth automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@semantic-release/npm passes --userconfig <empty-temp-file> to npm publish, overriding npm's normal config resolution and preventing the OIDC token exchange from working. Fix: use @semantic-release/npm only for version bumping (npmPublish: false) and @semantic-release/exec to call npm publish directly, which uses npm's native OIDC flow via the .npmrc created by actions/setup-node. Co-Authored-By: Claude Opus 4.6 (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.
Summary
@semantic-release/npmpasses--userconfig <empty-temp-file>tonpm publish, which overrides npm's normal config resolution and prevents the OIDC token exchange from working with trusted publishing.Fix:
@semantic-release/npmonly for version bumping (npmPublish: false)@semantic-release/execwithpublishCmd: "npm publish package"to call npm directly.npmrccreated byactions/setup-nodeactions/setup-nodewithregistry-urlto configure npm for OIDC