Skip to content

ci: publish to npm via OIDC trusted publishing#90

Merged
pascal-klesse merged 1 commit into
mainfrom
ci/oidc-trusted-publishing
May 20, 2026
Merged

ci: publish to npm via OIDC trusted publishing#90
pascal-klesse merged 1 commit into
mainfrom
ci/oidc-trusted-publishing

Conversation

@pascal-klesse
Copy link
Copy Markdown
Member

Why

npm granular access tokens have a max expiry and classic non-expiring automation tokens are being deprecated. The NPM_TOKEN secret expired and silently broke the 1.24.1 publish (404 on PUT). Rotating a token just resets the timer.

What

Switch the Publish workflow to npm Trusted Publishing (OIDC) — npm mints a short-lived, workflow-scoped token at run time. No NPM_TOKEN secret, nothing to expire or rotate.

  • permissions: id-token: write
  • Node 20 → 22 (OIDC needs Node ≥ 22.14.0) + npm install -g npm@latest (OIDC support landed in npm 11.5.1)
  • Drop JS-DevTools/npm-publish@v3 + secrets.NPM_TOKEN → plain npm publish
  • Add workflow_dispatch so an existing release can be (re-)published without recreating the GitHub Release

Prerequisite (done)

A Trusted Publisher is configured on npmjs.com for @lenne.tech/cli → repo lenneTech/cli, workflow publish.yml.

🤖 Generated with Claude Code

npm granular access tokens have a max expiry and the classic
non-expiring automation tokens are being deprecated, so the NPM_TOKEN
secret silently broke publishing overnight. Switch to npm Trusted
Publishing (OIDC): npm mints a short-lived, workflow-scoped token at
run time — nothing to expire or rotate.

Requires a Trusted Publisher configured on npmjs.com (repo lenneTech/cli,
workflow publish.yml). Bumps Node 20 -> 22 and upgrades npm to >= 11.5.1
(OIDC support landed in 11.5.1), adds `id-token: write`, drops the
JS-DevTools/npm-publish action + NPM_TOKEN in favour of plain
`npm publish`. Adds workflow_dispatch so a release can be re-published
without recreating the GitHub Release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pascal-klesse pascal-klesse merged commit ae3db88 into main May 20, 2026
1 check passed
@pascal-klesse pascal-klesse deleted the ci/oidc-trusted-publishing branch May 20, 2026 19:30
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.

1 participant