ci: publish to npm via trusted publishing (OIDC) - #143
Closed
sherlock-stallion wants to merge 1 commit into
Closed
sherlock-stallion wants to merge 1 commit into
sherlock-stallion wants to merge 1 commit into
Conversation
Drop NPM_TOKEN and let npm authenticate the publish through GitHub's OIDC token instead. This needs id-token: write, which replaces the blanket write-all with the scopes the release actually uses. Trusted publishing only exists in @semantic-release/npm 13.1.0 and later; the pinned semantic-release 19.0.3 resolves 9.0.2, which always writes an auth token into .npmrc and runs npm whoami, so it cannot publish without a token. Bump to semantic-release 25.0.9 (resolves @semantic-release/npm 13.2.0) and move @semantic-release/changelog and @semantic-release/git to majors that support it. Those packages raise the Node floor to ^22.14.0 || >=24.10.0 (changelog and git want >=24.15), and semantic-release fails hard rather than warning when the runtime is older, so the shared setup action moves from Node 20 to 24. Since yarn errors on incompatible engines, the same bump is what keeps yarn install --frozen-lockfile working for the pre-release checks too. npm ties the trusted publisher to this workflow's file name, so ci.yml is updated in place rather than replaced by a new release workflow. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Drop NPM_TOKEN and let npm authenticate the publish through GitHub's OIDC token instead. This needs id-token: write, which replaces the blanket write-all with the scopes the release actually uses.
Trusted publishing only exists in @semantic-release/npm 13.1.0 and later; the pinned semantic-release 19.0.3 resolves 9.0.2, which always writes an auth token into .npmrc and runs npm whoami, so it cannot publish without a token. Bump to semantic-release 25.0.9 (resolves @semantic-release/npm 13.2.0) and move @semantic-release/changelog and @semantic-release/git to majors that support it.
Those packages raise the Node floor to ^22.14.0 || >=24.10.0 (changelog and git want >=24.15), and semantic-release fails hard rather than warning when the runtime is older, so the shared setup action moves from Node 20 to 24. Since yarn errors on incompatible engines, the same bump is what keeps yarn install --frozen-lockfile working for the pre-release checks too.
npm ties the trusted publisher to this workflow's file name, so ci.yml is updated in place rather than replaced by a new release workflow.