fix: use local semantic-release instead of yarn dlx#124
Merged
Conversation
The yarn dlx approach doesn't work with npm OIDC Trusted Publishing because it runs in a sandboxed environment that loses the OIDC token context. Using 'yarn semantic-release' runs the locally installed semantic-release which properly inherits the GitHub Actions OIDC token for npm publishing.
|
🎉 This PR is included in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Use
yarn semantic-releaseinstead ofyarn dlx semantic-releasein the release workflow.Problem
The
yarn dlxapproach doesn't work with npm OIDC Trusted Publishing. When runningyarn dlx semantic-release, it spawns a sandboxed environment that loses the GitHub Actions OIDC token context, causing npm publish to fail with:Solution
Using
yarn semantic-releaseruns the locally installed semantic-release within the same context that has OIDC access, preserving the trusted publishing authentication.Changes
.github/workflows/release.yml— changedyarn dlx semantic-releasetoyarn semantic-releaseRelated
This is related to the Yarn Berry OIDC support - see yarnpkg/berry#6898 for details on OIDC support in Yarn.