fix(ci): restore token auth with provenance for npm publishing#76
Merged
Conversation
OIDC provenance does not replace token authentication — npm requires a token to authorize the publish request. Provenance adds a signed attestation and the trusted publisher config on npmjs.com makes it mandatory. Restore registry-url and NODE_AUTH_TOKEN from NPM_TOKEN secret. Use a granular access token which bypasses 2FA (unlike classic tokens that require OTP).
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.
Problem
npm publish --provenancewithout a token fails withENEEDAUTH. OIDC provenance does not replace token authentication — it adds a signed attestation alongside the publish. The trusted publisher config on npmjs.com makes provenance mandatory, but a token is still required to authorize the request.Fix
Restore
registry-urlandNODE_AUTH_TOKENfromNPM_TOKENsecret. Combined with--provenanceandid-token: write, this gives us both token auth and provenance attestation.Setup required
The
NPM_TOKENsecret in thenpm-publishenvironment must be a granular access token (not a classic/automation token):linearis, permission Read and writeNPM_TOKENin Settings → Environments → npm-publish → SecretsGranular tokens bypass 2FA by design, avoiding the
EOTPerror that classic tokens cause in CI.After merge
git pull origin main git tag -d v2026.4.1 git push origin :refs/tags/v2026.4.1 git tag -a v2026.4.1 -m "Release 2026.4.1" git push origin v2026.4.1