fix(release): use OIDC trusted publishing for npm auth#56
Merged
Conversation
The project .npmrc set _authToken=${NODE_AUTH_TOKEN} but the env var was
never populated, sending an empty token that overrode npm's native OIDC
flow and caused 404 on publish.
- Remove .npmrc (empty auth token was masking OIDC)
- Add registry-url to setup-node (configures OIDC auth exchange)
- Add --provenance flag directly on npm publish
- Remove redundant NPM_CONFIG_PROVENANCE env var
- Add concurrency group to prevent duplicate release runs
- Rebase before push in changelog sync to avoid non-fast-forward
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
.npmrc— contained_authToken=${NODE_AUTH_TOKEN}but the env var was never set, sending an empty auth token that overrode npm's native OIDC flow and causedE404on publishregistry-urltosetup-node— configures.npmrcfor the OIDC auth exchange per npm trusted publishing docs--provenancetonpm publish— explicit flag on the command; remove redundantNPM_CONFIG_PROVENANCEenv varconcurrencygroup — prevents duplicate release workflow runs when two CI runs complete in quick successiongit pull --rebasebefore push in changelog sync — prevents non-fast-forward rejection when main moves between publish and syncRoot Cause
The project
.npmrcset_authToken=${NODE_AUTH_TOKEN}. SinceNODE_AUTH_TOKENwas never populated in the workflow, npm sent an empty auth token to the registry. This overrode npm's native OIDC authentication flow (trusted publishing), causing theE404 Not Found - PUTerror on every publish attempt.Test plan
concurrencygroup queues (not cancels) concurrent releases