chore: switch npm publish to OIDC trusted publisher#174
Merged
Conversation
Remove NPM_TOKEN secret dependency — npm auth is now handled via GitHub Actions OIDC (id-token: write was already set). Bump Node to 22 as required by npm trusted publishing. Requires configuring the trusted publisher on npmjs.com: Package: @enbox/gitd Org: enboxorg Repo: gitd Workflow: npm-release.yml
LiranCohen
added a commit
that referenced
this pull request
Mar 4, 2026
Node 22 ships npm 10.x which does not support OIDC trusted publishing
(requires npm 11.5.1+). Node 24 ships npm 11+.
The registry-url param in setup-node creates an .npmrc with
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}. Since no
NODE_AUTH_TOKEN is set (we removed it in #174), npm uses an empty
token instead of auto-detecting the OIDC environment. Removing
registry-url lets npm default to registry.npmjs.org and perform
OIDC token exchange correctly.
LiranCohen
added a commit
that referenced
this pull request
Mar 4, 2026
Node 22 ships npm 10.x which does not support OIDC trusted publishing
(requires npm 11.5.1+). Node 24 ships npm 11+.
The registry-url param in setup-node creates an .npmrc with
//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}. Since no
NODE_AUTH_TOKEN is set (we removed it in #174), npm uses an empty
token instead of auto-detecting the OIDC environment. Removing
registry-url lets npm default to registry.npmjs.org and perform
OIDC token exchange correctly.
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.
Summary
NPM_TOKEN/NODE_AUTH_TOKENsecrets from the release workflow — npm auth is now handled via GitHub Actions OIDC trusted publishingid-token: writepermission was already setBefore merging
Configure the trusted publisher on https://www.npmjs.com/package/@enbox/gitd/settings:
enboxorggitdnpm-release.ymlNo secrets to manage or rotate. Provenance attestations are generated automatically.