fix(ci): use npm token instead of OIDC provenance for publishing#74
Merged
Conversation
OIDC provenance publishing fails with E404 after the repository transfer to linearis-oss. npm's trusted publisher verification rejects the publish even with matching config. Switch to explicit NPM_TOKEN secret authentication: - Drop --provenance flag from npm publish - Remove id-token: write permission (no longer needed) - Set NODE_AUTH_TOKEN explicitly from NPM_TOKEN secret Requires an npm automation or granular access token with publish permission stored as NPM_TOKEN in the npm-publish environment.
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 --provenancefails with E404 after the repository transfer tolinearis-oss. npm's OIDC trusted publisher verification rejects the publish even with the trusted publisher config updated on npmjs.com.See: https://github.com/linearis-oss/linearis/actions/runs/24093992364/job/70287901207
Root cause
npm provenance uses OIDC tokens whose claims must exactly match the trusted publisher configuration. After the org transfer, the verification continues to fail — likely due to npm-side propagation or claim mismatch.
Fix
Switch from OIDC provenance to explicit npm token authentication:
--provenanceflag fromnpm publishid-token: writepermission (no longer needed)NODE_AUTH_TOKENexplicitly fromNPM_TOKENsecretSetup required
linearispackageNPM_TOKENsecret in the repo'snpm-publishenvironment (Settings → Environments → npm-publish → Secrets)After merge
Re-tag to trigger publish:
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