Repository navigation
ci(release): stop auto-releasing when the package did not change - #1335
Merged
Merged
Conversation
The release job checked out a shallow clone without tags, so git describe found no tag and every push to main without changesets was treated as a first release. That published 3.0.1, identical to 3.0.0, after a GitHub Actions bump. Fetch full history, skip when no tag is found, and only consider changes under packages/mailer/.
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.
Problem
3.0.1was published with exactly the same code as3.0.0. Onlypackage.jsonandCHANGELOG.mdchanged, and the changelog entry just reads "Auto-release patch version with latest changes."What happened:
release.ymllooks up the last release withgit describe --tags.fetch-depth: 1, so no tags are available.CHANGES="first-release"and writes a patch changeset.mainthat has no changesets: Dependabot bumps, CI-only changes, docs.That is how #1333, a GitHub Actions bump, became 3.0.1. From the Release run log for
6918804:Fix
fetch-depth: 0, so history and tags are available.packages/mailer/(the published package) trigger an automatic release and its bump analysis. Previouslyapps/changes (website) also triggered one.Verification
I simulated the new logic against real history:
6918804(Actions bump, #1333)@nestjs-modules/mailer@3.0.0647406d(#1328)@nestjs-modules/mailer@2.3.10No changeset is needed: this only touches CI. With the fix in place, merging it will not publish a new version.