-
Notifications
You must be signed in to change notification settings - Fork 0
ci: switch npm publish to Trusted Publishing (OIDC) #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,5 +90,8 @@ jobs: | |
| publish-package: | ||
| needs: publish-release | ||
| uses: ./.github/workflows/npm-publish.yml | ||
| secrets: | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| # npm Trusted Publishing (OIDC) — no NPM_TOKEN secret needed. | ||
| # The called workflow declares `permissions: id-token: write` itself. | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
Comment on lines
+95
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Workflow-level The workflow-level Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩
npm publishmay need--provenanceflag for OIDC authenticationThe PR removes
NODE_AUTH_TOKENfrom thenpm publishstep (npm-publish.yml:36-37) but does not add--provenanceto thenpm publishcommand. Theactions/setup-nodeaction withregistry-urlcreates an.npmrccontaining//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}. SinceNODE_AUTH_TOKENis no longer set, the auth token will be empty.npm Trusted Publishing historically requires
npm publish --provenanceto trigger the OIDC token exchange for authentication. Without this flag and withoutNODE_AUTH_TOKEN, there may be no valid authentication mechanism. However, npm's OIDC support has been evolving — newer npm versions (10.x+ with Node 22) may handle this differently. This should be verified against the current npm Trusted Publishing documentation and tested before merging.Was this helpful? React with 👍 or 👎 to provide feedback.