Skip to content

fix(ci): use OIDC provenance for npm publish#826

Merged
rajbos merged 3 commits into
mainfrom
rajbos/prep-release
May 9, 2026
Merged

fix(ci): use OIDC provenance for npm publish#826
rajbos merged 3 commits into
mainfrom
rajbos/prep-release

Conversation

@rajbos
Copy link
Copy Markdown
Owner

@rajbos rajbos commented May 9, 2026

Problem

The Publish to npm step was setting NODE_AUTH_TOKEN="", which explicitly cleared the auth token that actions/setup-node configures when registry-url is provided. This caused ENEEDAUTH failures even though the job already had id-token: write for OIDC publishing.

Fix

Removed the NODE_AUTH_TOKEN override and added --provenance --access public to both the publish and dry-run steps. With --provenance, npm automatically exchanges the GitHub Actions OIDC token for a short-lived registry token - no secret needed.

rajbos and others added 3 commits May 9, 2026 13:27
NODE_AUTH_TOKEN was explicitly set to empty string, which overrode
the auth configured by setup-node and caused ENEEDAUTH failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove NODE_AUTH_TOKEN override (empty string broke auth) and add
--provenance flag so npm exchanges the OIDC token automatically.
id-token: write permission is already set on the job.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos enabled auto-merge May 9, 2026 11:35
@rajbos rajbos merged commit c98fde5 into main May 9, 2026
18 checks passed
@rajbos rajbos deleted the rajbos/prep-release branch May 9, 2026 11:37
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