feat: migrate npm-release.yml to OIDC trusted publishing#952
Draft
kdaviduik wants to merge 1 commit intographite-base/952from
Draft
feat: migrate npm-release.yml to OIDC trusted publishing#952kdaviduik wants to merge 1 commit intographite-base/952from
kdaviduik wants to merge 1 commit intographite-base/952from
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
018b0c0 to
c6173bc
Compare
52ca1a3 to
9383c98
Compare
This was referenced Mar 14, 2026
9383c98 to
8ebf841
Compare
Replace static NPM_TOKEN authentication with OIDC token exchange for npm publishing. OIDC provides short-lived tokens derived from the GitHub Actions workflow identity, eliminating the risk of long-lived credential compromise. Key changes: - Node version: 18.20 → 24 (bundles npm 11 with native OIDC support) - Remove NODE_AUTH_TOKEN env var (leaving it undefined triggers OIDC) - Set NPM_TOKEN to empty string (forces OIDC fallback) - Fix package.json repository field from SSH shorthand to structured HTTPS format (required for OIDC provenance attestation) - id-token: write permission already present from PR 1 Build gate: verified build + 794 tests pass on Node 24.14.0 (npm 11.9.0) Snapit OIDC migration deferred — only npm-release.yml is configured as a Trusted Publisher on npmjs.com. Snapit continues using NPM_TOKEN.
8ebf841 to
cfb88ff
Compare
c6173bc to
215a2cc
Compare
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.

Part of https://github.com/Shopify/developer-tools-team/issues/1195
Summary
NPM_TOKENto OIDC trusted publishingpackage.jsonrepository field from SSH shorthand to structured HTTPS format (required for provenance attestation)Why
OIDC replaces long-lived
NPM_TOKENsecrets with short-lived tokens derived from the GitHub Actions workflow identity. This eliminates the risk of credential compromise — tokens are scoped to the specific workflow run and cannot be reused. Standard at Shopify (Hydrogen, CLI, theme-tools, flash-list).npm classic tokens were revoked December 9, 2025. This repo's
NPM_TOKENwas a classic token, so it's already dead and this migration is a necessity in order to do future npm releases.How OIDC works
id-token: writepermission (already present from PR 1) allows the workflow to request an OIDC token from GitHubsetup-nodewithregistry-urlconfigures.npmrcfor authNODE_AUTH_TOKENis NOT set — this causes npm to fall through to OIDC token exchangeNPM_TOKEN: ''(empty string) explicitly forces OIDC fallbackSnapit
(similar to Hydrogen) Snapit OIDC migration is deferred. Only
npm-release.ymlis configured as a Trusted Publisher on npmjs.com./snapitto test our changes and verify everything works. We can instead just manually build this package and use that rather than the npm release from/snapit