Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

Switch publish workflow to npm Trusted Publishing - #26

Merged
michielbdejong merged 1 commit into
mainfrom
claude/youthful-mendel-3ujtxo
Sep 21, 2026
Merged

michielbdejong merged 1 commit into
mainfrom
claude/youthful-mendel-3ujtxo

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #25 (merged): replaces the NPM_TOKEN-secret approach with npm's newer OIDC-based Trusted Publishing, per the maintainer's request. No long-lived secret is stored at all — the package's Settings → Trusted Publisher page on npmjs.com is now configured to trust this exact repo and workflow filename (publish.yml), and each run mints a short-lived, run-scoped publish credential via id-token: write.

Changes

  • publish.yml: adds permissions: { contents: read, id-token: write } at the job level, drops the NODE_AUTH_TOKEN/secrets.NPM_TOKEN env entirely, and upgrades npm to latest before publishing (Node 22's bundled npm predates OIDC trusted-publishing support).
  • README's "Publishing" section updated to describe Trusted Publishing instead of the NPM_TOKEN secret.

Verification

pnpm install, pnpm lint, pnpm run build, pnpm test (105 passing) all green locally. The OIDC exchange itself can only be exercised by an actual push to main, since GitHub only issues the OIDC token in that real workflow context — but the trusted-publisher config is already in place on npmjs.com per the maintainer.

https://claude.ai/code/session_01B2mbssSNDiu8GpKjaCFRn1


Generated by Claude Code

Replaces the NPM_TOKEN-secret approach from the previous PR with npm's
OIDC-based Trusted Publishing: the package's Settings -> Trusted Publisher
on npmjs.com now trusts this exact repo + workflow filename, so the
workflow mints a short-lived, run-scoped publish credential via
id-token: write instead of relying on a long-lived stored secret.

Also upgrades npm to latest in the job before publishing, since Node 22's
bundled npm predates OIDC trusted-publishing support.

Claude-Session: https://claude.ai/code/session_01B2mbssSNDiu8GpKjaCFRn1
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@michielbdejong
michielbdejong merged commit 654c256 into main Sep 21, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants