Repository navigation
Publish to npm through trusted publishing - #38
Merged
Merged
Conversation
Every package already on npm now has a trusted publisher for this repository and npm-publish.yml. The job gets an OIDC token (id-token: write) and npm 11.5.1 or later, which exchanges it for a publish token; NPM_TOKEN stays as the fallback, since a package's first publish cannot use a trusted publisher yet. Provenance is turned off for the publish: trusted publishing generates it, and the registry checks it against repository.url, which no package sets to this repository.
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.
Changes
npm-publish.ymlto publish through npm's trusted publishing (OIDC). The two most recent runs failed withEOTP, because the token couldn't publish without a one-time password.All 21
@mapconductorpackages already on npm now have a trusted publisher forMapConductor/react-sdk/npm-publish.yml, withnpm publishallowed.Changes
permissions: id-token: write: lets the job get an OIDC token, which npm exchanges for a short-lived publish token.--provenance=falseonnpm publish: under trusted publishing npm generates provenance automatically, and the registry checks it againstrepository.url. Most packages have norepositoryfield, and js-vectorstyle and react-vectortile name their own repositories, so it would not match this repository.NODE_AUTH_TOKEN: stays as the fallback. A trusted publisher can only be added to a package that already exists, so a package's first publish still needs the token.For the 0.3.0 release
NPM_TOKEN. With the current token that fails withEOTP.excludealongside the four react-icons packages. The other 20 then publish through OIDC.Checks