Skip to content

ci: switch npm publish to OIDC trusted publishing#57

Merged
ABB65 merged 1 commit into
mainfrom
ci/npm-trusted-publishing-oidc
Jun 22, 2026
Merged

ci: switch npm publish to OIDC trusted publishing#57
ABB65 merged 1 commit into
mainfrom
ci/npm-trusted-publishing-oidc

Conversation

@ABB65

@ABB65 ABB65 commented Jun 22, 2026

Copy link
Copy Markdown
Member

Moves npm publishing from a long-lived NPM_TOKEN to OIDC trusted publishing.

Changes (release.yml)

Prerequisite (done)

Trusted publisher configured per package on npmjs.com — org=Contentrain, repo=ai, workflow=release.yml — for @contentrain/mcp, @contentrain/rules, @contentrain/skills, and contentrain.

Effect

  • No more long-lived npm token to manage/leak; provenance is generated automatically.
  • Fixes the unscoped contentrain CLI publish: the old token was scoped to @contentrain/* only, so the CLI 403d and npm stayed at 0.5.1 (repo is at 0.5.4). OIDC identity is per-workflow, not per-scope.
  • On merge: no changesets are pending, so the Release workflow runs changeset publish, which will publish contentrain@0.5.4 via OIDC and close the version gap.

Follow-up

Once the first OIDC release is confirmed green, the npm granular NPM_TOKEN and its GitHub secret can be deleted.

Replace the long-lived NPM_TOKEN with npm trusted publishing (OIDC):
- Drop NPM_TOKEN / NODE_AUTH_TOKEN from the changesets publish step; npm
  authenticates via the existing id-token: write OIDC permission.
- Upgrade npm to latest before publish — Node 22 ships npm 10.x but
  trusted publishing requires npm >= 11.5.1 (also avoids the known OIDC
  E404 on scoped packages).

Requires a trusted publisher configured per package on npmjs.com
(org=Contentrain, repo=ai, workflow=release.yml) — done for all four
packages. This also removes the token-scope limitation that kept the
unscoped `contentrain` CLI from publishing (npm stuck at 0.5.1); the
next release on main will publish contentrain@0.5.4 via OIDC.
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for contentrain-ai ready!

Name Link
🔨 Latest commit 69603ad
🔍 Latest deploy log https://app.netlify.com/projects/contentrain-ai/deploys/6a391f3549c18a0008fab393
😎 Deploy Preview https://deploy-preview-57--contentrain-ai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ABB65 ABB65 merged commit d4a175c into main Jun 22, 2026
6 checks passed
@ABB65 ABB65 deleted the ci/npm-trusted-publishing-oidc branch June 22, 2026 11:44
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 22, 2026
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.

1 participant