feat: configure npm OIDC trusted publishing for release workflow - #7
Merged
Merged
Conversation
Verifies the release pipeline (version calculation, changelog generation, npm pack) without actually publishing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Branch protection prevents pushing directly to main. Remove @semantic-release/changelog and @semantic-release/git — GitHub Releases are sufficient for changelog. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
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
actions/setup-nodewithregistry-url: https://registry.npmjs.orgto the release workflow.npmrc, whichactions/setup-nodehandles@semantic-release/npmverifies OIDC works but npm itself has no registry config to perform the token exchange during publish, causingENEEDAUTH--provenanceflag orNPM_TOKENis needed — npm handles auth and provenance automatically when trusted publishing is configuredprepublishOnlylifecycle scripts continue to work normally