Skip to content

ci(release): stop auto-releasing when the package did not change - #1335

Merged
juandav merged 1 commit into
mainfrom
fix/release-auto-changeset
Oct 4, 2026
Merged

juandav merged 1 commit into
mainfrom
fix/release-auto-changeset

Conversation

@juandav

@juandav juandav commented Oct 4, 2026

Copy link
Copy Markdown
Member

Problem

3.0.1 was published with exactly the same code as 3.0.0. Only package.json and CHANGELOG.md changed, and the changelog entry just reads "Auto-release patch version with latest changes."

What happened:

  • The "Auto-create changeset" step in release.yml looks up the last release with git describe --tags.
  • The release job checks out with the default fetch-depth: 1, so no tags are available.
  • The fallback then sets CHANGES="first-release" and writes a patch changeset.
  • This happens on every push to main that 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:

fetch-depth: 1
Source changes detected, determining version bump...
Detected bump type: patch

Fix

  • The release job checks out with fetch-depth: 0, so history and tags are available.
  • If no tag is found, the step skips with a warning instead of assuming a first release.
  • Only changes under packages/mailer/ (the published package) trigger an automatic release and its bump analysis. Previously apps/ changes (website) also triggered one.

Verification

I simulated the new logic against real history:

Commit Last tag Package changes Result
6918804 (Actions bump, #1333) @nestjs-modules/mailer@3.0.0 none skip (previously released 3.0.1)
647406d (#1328) @nestjs-modules/mailer@2.3.10 yes major

No changeset is needed: this only touches CI. With the fix in place, merging it will not publish a new version.

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/.
@juandav
juandav merged commit 41ea2c6 into main Oct 4, 2026
7 checks passed
@juandav
juandav deleted the fix/release-auto-changeset branch October 4, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant