chore: migrate npm publish to OIDC Trusted Publishing#28
Merged
Conversation
Drops the long-lived NPM_TOKEN secret in favor of npm Trusted Publishing. GitHub Actions OIDC tokens authenticate the publish, scoped to this repo+workflow combo, so publish capability cannot be exercised from elsewhere even if repo write access leaks. - Add 'Upgrade npm' step so the CLI is >= 11.5.1 (setup-node@v6 ships npm 10.x, which doesn't support trusted publishing) - Remove NODE_AUTH_TOKEN env from the publish step Requires Trusted Publisher to be configured on all 7 packages on npmjs.com before this merges, otherwise the next release fails.
jasonjul
approved these changes
May 11, 2026
Node 24 LTS ships npm 11.x natively, which already satisfies the >= 11.5.1 requirement for Trusted Publishing. The 'Upgrade npm' step becomes redundant.
weiyuan95
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NPM_TOKENsecret to npm Trusted Publishing (OIDC)actions/setup-nodefrom Node 20 to 24 so the bundled npm (11.x) already satisfies the >= 11.5.1 requirement for Trusted PublishingNODE_AUTH_TOKENenv block from the publish stepPrerequisite (must complete before merge)
Trusted Publisher must be configured on all 7 packages on npmjs.com, otherwise the next release fails:
@coingecko/cg@coingecko/cg-darwin-arm64,@coingecko/cg-darwin-x64@coingecko/cg-linux-arm64,@coingecko/cg-linux-x64@coingecko/cg-win32-arm64,@coingecko/cg-win32-x64Settings per package: GitHub Actions / coingecko / coingecko-cli / release.yml / (no environment)
Test plan
NPM_TOKENCleanup (post-verification, separate task)
NPM_TOKENfrom repo secrets🤖 Generated with Claude Code