Switch npm publishing to OIDC Trusted Publishing - #89
Merged
Conversation
Replace the token-based JS-DevTools/npm-publish action with plain npm publish using npm's OIDC Trusted Publishing. The job now requests the id-token: write permission and no longer needs the NPM_TOKEN secret. Already-published versions are skipped, matching the previous 'upgrade' strategy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TM7ZGa7FZrvPXjD1BJM4L3
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Switches the
Publishworkflow from token-based publishing (JS-DevTools/npm-publish@v4with theNPM_TOKENsecret) to npm OIDC Trusted Publishing.permissions: id-token: write(pluscontents: read) to the publish job so the runner can mint the OIDC token that npm exchanges for short-lived credentials.npm publish --access public --tag ...for each package in the same dependency order — no token involved. Provenance attestations are generated automatically with Trusted Publishing.--access public, thenextdist-tag for prereleases, and skipping packages whose current version is already on the registry (equivalent to the action'sstrategy: upgrade, so workflow re-runs stay safe).npm install -g npm@lateststep, since Trusted Publishing requires npm ≥ 11.5.1 and Node 22 bundles npm 10.x.The
deploy-verceljob is unrelated to npm and is unchanged.Required setup before merging/releasing
A Trusted Publisher must be configured on npmjs.com for each of the 8 packages (
@nitrogql/esbuild-register,core,loader-core,wasi-preview1,cli,graphql-loader,rollup-plugin,jest-transform): package Settings → Trusted Publisher → GitHub Actions, with organization/useruhyo, repositorynitrogql, workflow filenamepublish.yaml, environment left blank. Until that's done,npm publishfor that package will fail with an auth error.After the first successful OIDC publish, the
NPM_TOKENrepository secret can be deleted and the token revoked. Optionally, each package's publishing access can be set to "Trusted Publisher only" to disallow token-based publishes entirely.🤖 Generated with Claude Code
https://claude.ai/code/session_01TM7ZGa7FZrvPXjD1BJM4L3
Generated by Claude Code