Skip to content

ci: publish npm via OIDC trusted publishing (drop NPM_TOKEN) - #162

Merged
joshdholtz merged 5 commits into
mainfrom
dx-npm-trusted-publishing
Aug 27, 2026
Merged

ci: publish npm via OIDC trusted publishing (drop NPM_TOKEN)#162
joshdholtz merged 5 commits into
mainfrom
dx-npm-trusted-publishing

Conversation

@joshdholtz

@joshdholtz joshdholtz commented Aug 27, 2026

Copy link
Copy Markdown
Member

Moves the release's npm publish off a long-lived NPM_TOKEN and onto OIDC trusted publishing, so there's no npm token to manage or leak.

  • Bump actions/setup-node to v7 (OIDC-aware).
  • Upgrade npm to >= 11.5.1 in the job (trusted publishing needs it; Node 20 ships npm 10).
  • Drop NODE_AUTH_TOKEN; auth is the workflow's existing id-token: write.

Requires before the next release: a trusted publisher configured for each of the 7 packages on npmjs.com (Settings -> Trusted Publisher -> GitHub Actions), pointing at RevenueCat/cli, workflow release.yml. Until every package is configured, its publish step fails.

Provenance still works (also OIDC-based). The NPM_TOKEN secret can be deleted once this is confirmed on a real release.


Note

Medium Risk
Release publishing behavior changes and will fail until each npm package has a trusted publisher configured for this repo and workflow; otherwise releases are blocked.

Overview
Release CI now publishes @revenuecat/cli and platform packages using npm OIDC trusted publishing instead of a long-lived NPM_TOKEN.

The release job bumps actions/setup-node to v7, uses Node 22, and installs npm 11.19.0 so trusted publishing meets npm’s minimum version. The publish step no longer sets NODE_AUTH_TOKEN; auth relies on the workflow’s existing id-token: write permission. scripts/package-npm.mjs comments are updated to describe CI OIDC auth.

Docs and npm metadata point at RevenueCat/cli (replacing RevenueCat/revenuecat-cli) in CHANGELOG, CONTRIBUTING, the npm launcher README/error text, generated package.json fields, and package-npm.mjs homepage/repository URLs.

Reviewed by Cursor Bugbot for commit eb62ee0. Bugbot is set up for automated code reviews on this repo. Configure here.

Switch the release's npm publish from a long-lived NPM_TOKEN to OIDC trusted
publishing: bump actions/setup-node to v7 (OIDC-aware), upgrade npm to >= 11.5.1
in the job, and drop NODE_AUTH_TOKEN. The workflow's existing id-token: write is
the auth. Requires a trusted publisher configured per package on npmjs.com.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joshdholtz
joshdholtz requested review from alfondotnet and fire-at-will and a lite review from Copilot August 27, 2026 13:41
@joshdholtz

Copy link
Copy Markdown
Member Author

bugbot run

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@latest would pull a same-day npm into the release pipeline, the exact thing our
dependency cooldown guards against (11.19.1 is 1 day old). 11.19.0 is ~a month
old and past the 3-day cooldown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joshdholtz

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c8e7ae8. Configure here.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread scripts/package-npm.mjs Outdated
- Trusted publishing needs Node >= 22.14.0 (and npm 12 dropped Node 20), so bump
  the release job to Node 22. npm stays pinned at 11.19.0.
- Correct the npm package repository/homepage URLs from the nonexistent
  RevenueCat/revenuecat-cli to RevenueCat/cli, which also matters for provenance
  verification.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
joshdholtz and others added 2 commits August 27, 2026 09:23
…UTING

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@joshdholtz
joshdholtz merged commit 448a999 into main Aug 27, 2026
5 checks passed
@joshdholtz
joshdholtz deleted the dx-npm-trusted-publishing branch August 27, 2026 14:25
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.

3 participants