Skip to content

fix(release): use OIDC trusted publishing for npm auth#56

Merged
iamladi merged 1 commit intomainfrom
fix/npm-oidc-publish
Apr 2, 2026
Merged

fix(release): use OIDC trusted publishing for npm auth#56
iamladi merged 1 commit intomainfrom
fix/npm-oidc-publish

Conversation

@iamladi
Copy link
Copy Markdown
Owner

@iamladi iamladi commented Apr 2, 2026

Summary

  • Remove .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 caused E404 on publish
  • Add registry-url to setup-node — configures .npmrc for the OIDC auth exchange per npm trusted publishing docs
  • Add --provenance to npm publish — explicit flag on the command; remove redundant NPM_CONFIG_PROVENANCE env var
  • Add concurrency group — prevents duplicate release workflow runs when two CI runs complete in quick succession
  • Add git pull --rebase before push in changelog sync — prevents non-fast-forward rejection when main moves between publish and sync

Root Cause

The project .npmrc set _authToken=${NODE_AUTH_TOKEN}. Since NODE_AUTH_TOKEN was 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 the E404 Not Found - PUT error on every publish attempt.

Test plan

  • Merge and verify the release workflow succeeds on next changeset publish
  • Confirm provenance attestation appears on the published npm package
  • Verify concurrency group queues (not cancels) concurrent releases

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
@iamladi iamladi merged commit a597d1b into main Apr 2, 2026
4 checks passed
@iamladi iamladi deleted the fix/npm-oidc-publish branch April 2, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant