Repository navigation
Migrate npm publishing to trusted publishing - #21
Merged
Merged
Conversation
|
durga256
marked this pull request as ready for review
October 6, 2026 18:25
Suleimanlatrsh
approved these changes
Oct 6, 2026
Suleimanlatrsh
left a comment
There was a problem hiding this comment.
Small nit: NPM_TOKEN: "" doesn't do anything here, so that env block can go. No need for a re-review.
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.
Why
The release workflow currently exposes a long-lived npm publishing credential to a public-repository GitHub Actions job. If that credential is exfiltrated, it can be reused to publish a malicious
@shopify/toml-patchversion.Addresses https://github.com/shop/issues/issues/84640 and https://vault.shopify.io/teams/2238-DevTools/issues/77805-secure-artifact-publish-tokens-and-harden-release-workflows-in-oss-repos.
What changed
contents: readand theid-token: writepermission required for npm Trusted PublishingNPM_TOKENsecret from the publish step so npm uses OIDCVerification
wasm-pack build --target nodejs --release --scope='shopify'— generatedpkg/package.jsonwithrepository.urlset tohttps://github.com/Shopify/toml-patchwasm-pack test --node— 30 tests passedyamllintand Ruby YAML parser — workflow is valid YAMLnpm view @shopify/toml-patch version --registry=https://registry.npmjs.org— package exists (0.3.0)Release prerequisite
Before the next release, configure
@shopify/toml-patchon npm with a GitHub Actions Trusted Publisher forShopify/toml-patchandpublish.yml, allowing directnpm publish. A new trusted-publisher configuration must complete its first publish within two days. After the first successful OIDC publish, remove the repository's oldNPM_TOKENsecret and configure npm publishing access to disallow token-based publishing.