Repository navigation
chore(ci): publish only when there is a release - #249
Merged
Merged
Conversation
semantic-release only releases when it finds a releasable commit, and the angular convention this repo uses does not treat `chore:` or `docs:` as one. The publish step ran on `if: success()` regardless, so a merge with no releasable commit published the version already in package.json, which npm rejects with "You cannot publish over the previously published versions". That is the failure in the earlier run on a `docs(lint):` merge. The step now compares the local version against the registry and exits early when they match, so a no-release merge is a clean no-op instead of a red pipeline. `released` is exported on GITHUB_OUTPUT for any step that wants to act only on a real release. Same guard as sasjs/adapter#902. Verified both branches with a stubbed npm on PATH, so the publish path is exercised without publishing anything: with the versions equal the step prints "Nothing to publish - 4.1.1 is already on npm", sets released=false and never calls npm publish; with a new version it calls `npm publish --access public` and sets released=true. The workflow still parses. Typed `chore(ci)` with `[skip release]` because this is CI-only and no consumer sees a difference - a patch release here would be version churn.
|
🎉 This PR is included in version 4.1.2 🎉 The release is available on GitHub release 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.
Publishes only when semantic-release actually cut a release, the same guard as sasjs/adapter#902.
The failure this fixes. The publish step ran on
if: success()regardless of whether semantic-release released anything:The angular convention does not treat
chore:ordocs:as releasable, so a merge with no releasable commit left package.json at the version already on npm, andnpm publishwas rejected with "You cannot publish over the previously published versions". That is the red run earlier today on adocs(lint):merge. It is a no-op now instead.Verified both branches, with a stubbed npm on PATH so the publish path runs without publishing anything:
The workflow still parses (prettier exit 0).
Typed
chore(ci)with[skip release]deliberately: this is CI-only, no consumer sees a difference, and a patch release would be version churn.