Repository navigation
Publish with npm trusted publishing - #154
Merged
Merged
Conversation
Write tokens expire in 90 days. OIDC removes NPM_TOKEN. Node 24 ships the npm CLI that can exchange the OIDC token.
Exchange the GitHub OIDC token with npm on this branch only. The publish job still runs on master alone.
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
ordercloud-javascript-sdkfromtag-and-publish.ymlwith GitHub OIDC instead ofNPM_TOKEN. npm write tokens max out at 90 days.id-token: writeand dropNODE_AUTH_TOKENfrom the publish step.Before merge
A package maintainer needs to add a trusted publisher on npm for
ordercloud-javascript-sdk:ordercloud-apiordercloud-javascript-sdktag-and-publish.ymlnpm publish(new publishers default to stage-only, and this workflow runsnpm publish)Leave the
NPM_TOKENsecret in place until one publish succeeds, then delete it and revoke the npm token.Test plan
tag-and-publish.ymlexactly14.0.0and that branch merges tomaster, a version bump publishes withoutNODE_AUTH_TOKENNPM_TOKENGitHub secret and revoke the npm granular token