Repository navigation
ci: publish with npm trusted publishing - #108
cacieprins wants to merge 1 commit into
Conversation
Export a CircleCI OIDC token for semantic-release to exchange for a short-lived npm publish token, and pin semantic-release 25. Move the release image to Node 22.21, since semantic-release 25 needs Node >= 22.14. Upgrade the config to version 2.1: CircleCI no longer compiles version 2 configs, so the next pipeline on master would fail without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8ec03b. Configure here.
| # short-lived publish token, so it has to be exported in the same step | ||
| - run: | | ||
| export NPM_ID_TOKEN=$(circleci run oidc get --claims '{"aud": "npm:registry.npmjs.org"}') | ||
| npx semantic-release@25.0.9 |
There was a problem hiding this comment.
Release image ships too-old npm
High Severity
cimg/node:22.21.0 bundles npm 10.9.4, but npm trusted publishing needs npm CLI 11.5.1+ to read NPM_ID_TOKEN and exchange it during publish. @semantic-release/npm skips writing an _authToken when OIDC is available and relies on that CLI, so the release job is likely to fail authentication.
Reviewed by Cursor Bugbot for commit b8ec03b. Configure here.


Moves
@cypress/requestpublishing to npm trusted publishing, so releases no longer need the sharedNPM_TOKEN.The trusted publisher is already registered on npm (CircleCI, this project, restricted to the
org-npm-credentialscontext), so this is safe to merge.NPM_ID_TOKEN) for@semantic-release/npmto exchange for a short-lived publish token. CircleCI support needs@semantic-release/npm13.2.0, which semantic-release 25 pulls in, so it's now pinned tosemantic-release@25.0.9.cimg/node:22.7.0to22.21.0, since semantic-release 25 needs Node >= 22.14.version: 2to2.1. CircleCI stopped compiling version 2 configs in July, so the next pipeline onmasterwould fail without this regardless. The lastmasterpipeline ran on 2026-05-28.org-npm-credentials, since the trusted publisher is restricted to that context.🤖 Generated with Claude Code
Note
Medium Risk
Release publishing path and toolchain change (OIDC + pinned semantic-release/Node); failure modes are mostly broken releases rather than app runtime, but npm publish auth is security-sensitive.
Overview
Updates CircleCI so npm releases use trusted publishing instead of a long-lived
NPM_TOKEN. The release job fetches an OIDC token asNPM_ID_TOKENin the same step assemantic-release@25.0.9, which exchanges it for a short-lived publish credential.Also bumps the CircleCI config to
version: 2.1(dropping the obsolete workflowsversion: 2) and moves the release runner fromcimg/node:22.7.0to22.21.0to satisfy Node requirements for semantic-release 25. The release job still uses the existingorg-npm-credentialscontext for the trusted publisher restriction.Reviewed by Cursor Bugbot for commit b8ec03b. Bugbot is set up for automated code reviews on this repo. Configure here.