Skip to content

Switch npm publishing to OIDC Trusted Publishing - #89

Merged
uhyo merged 1 commit into
masterfrom
claude/npm-oidc-publishing-o0rxew
Aug 9, 2026
Merged

Switch npm publishing to OIDC Trusted Publishing#89
uhyo merged 1 commit into
masterfrom
claude/npm-oidc-publishing-o0rxew

Conversation

@uhyo

@uhyo uhyo commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Switches the Publish workflow from token-based publishing (JS-DevTools/npm-publish@v4 with the NPM_TOKEN secret) to npm OIDC Trusted Publishing.

  • Adds permissions: id-token: write (plus contents: read) to the publish job so the runner can mint the OIDC token that npm exchanges for short-lived credentials.
  • Replaces the eight per-package action steps with a single step that runs plain npm publish --access public --tag ... for each package in the same dependency order — no token involved. Provenance attestations are generated automatically with Trusted Publishing.
  • Preserves the previous behavior: --access public, the next dist-tag for prereleases, and skipping packages whose current version is already on the registry (equivalent to the action's strategy: upgrade, so workflow re-runs stay safe).
  • Adds an npm install -g npm@latest step, since Trusted Publishing requires npm ≥ 11.5.1 and Node 22 bundles npm 10.x.

The deploy-vercel job 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/user uhyo, repository nitrogql, workflow filename publish.yaml, environment left blank. Until that's done, npm publish for that package will fail with an auth error.

After the first successful OIDC publish, the NPM_TOKEN repository 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

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
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nitrogql Ready Ready Preview Aug 8, 2026 2:33pm

@uhyo
uhyo merged commit 0919c35 into master Aug 9, 2026
9 checks passed
@uhyo
uhyo deleted the claude/npm-oidc-publishing-o0rxew branch August 9, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants