ci: don't allow breaking changes in PR commit messages - #44943
Closed
jamietanna wants to merge 1 commit into
Closed
Conversation
jamietanna
force-pushed
the
ci/no-breaking
branch
from
July 29, 2026 12:23
334e5e7 to
d7ff47a
Compare
Renovate 44.0.0 was incorrectly released from #44004 due to the `BREAKING ...` reference in the commit message. Renovate uses Squash Merge as our method for merging commits into `main`, and when enabled with the Merge Queue[0], this doesn't provide maintainers with the ability to inspect the commit messages before merging (which would be the case if not using the Merge Queue, we would likely rewrite the commit message prior to merge. With this in mind, Renovate maintainers often don't inspect the commit messages, allowing them to stay as they are, as they'll be squashed into the final commit. In the case of #44004, this led to us missing the `BREAKING ...` trailing message - from changes that were split into #44939 - and because of this, semantic-release published this as a major release. As a means to prevent this happening again, we can introduce a CI check that validates - with the same underlying library as semantic-release - whether a major release is being suggested, and if so, rejecting it. Co-authored-by: Claude Opus 4.8 (1M context) <jamie.tanna+claude-code@mend.io>
jamietanna
force-pushed
the
ci/no-breaking
branch
from
July 29, 2026 13:06
d7ff47a to
edb47ab
Compare
jamietanna
commented
Jul 29, 2026
| "@hyrious/marshal": "0.3.3", | ||
| "@ls-lint/ls-lint": "2.3.1", | ||
| "@openpgp/web-stream-tools": "0.3.1", | ||
| "@semantic-release/commit-analyzer": "13.0.1", |
Contributor
Author
There was a problem hiding this comment.
Should this be bound to the version that semantic-release uses?
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a CI guardrail to prevent PR commit messages from accidentally triggering a major release per Renovate’s existing semantic-release rules, by reusing @semantic-release/commit-analyzer in a standalone check.
Changes:
- Add a new
tools/check-major-release.tsscript (plus tests) that computes the release type from PR commit messages using.releaserc.json. - Add a new GitHub Actions job that collects PR commit messages via the GitHub API and fails if a major release would be produced.
- Add
@semantic-release/commit-analyzeras a dependency and introduce a local.d.tsshim for its exported function.
Key review findings (blocking)
- The workflow runs
node tools/check-major-release.ts, but the script contains TypeScript-only syntax (export type ...). Unless Node is explicitly configured to strip types / load TS in./.github/actions/setup-node, this step will fail at runtime. - The script generates synthetic commit hashes; commit-analyzer’s revert filtering (and any hash-based correlation) is most reliable with real SHAs. The workflow currently collects only messages, so reverted breaking commits could still be counted and incorrectly fail CI.
// Co-authored-by: ...is committed into the source file header; this metadata belongs in git commit trailers, not in repository source.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tools/commit-analyzer.d.ts |
Adds minimal type declarations for @semantic-release/commit-analyzer so the new tool can be typed. |
tools/check-major-release.ts |
Implements the release-type computation and CI error reporting based on existing .releaserc.json. |
tools/check-major-release.spec.ts |
Adds Vitest coverage for major/minor/patch/null cases and offender detection. |
package.json |
Adds @semantic-release/commit-analyzer dependency needed by the new tool. |
pnpm-lock.yaml |
Locks the new dependency version. |
.github/workflows/check-commit-messages.yml |
Adds a new job that collects PR commit messages and runs the major-release check. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
12 tasks
Contributor
Author
|
Replaced by #44944 |
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.
Changes
Renovate 44.0.0 was incorrectly released from #44004 due to the
BREAKING ...reference in the commit message.Renovate uses Squash Merge as our method for merging commits into
main, and when enabled with the Merge Queue[0], this doesn't providemaintainers with the ability to inspect the commit messages before
merging (which would be the case if not using the Merge Queue, we would
likely rewrite the commit message prior to merge.
With this in mind, Renovate maintainers often don't inspect the commit
messages, allowing them to stay as they are, as they'll be squashed into
the final commit.
In the case of #44004, this led to us missing the
BREAKING ...trailing message - from changes that were split into #44939 - and
because of this, semantic-release published this as a major release.
As a means to prevent this happening again, we can introduce a CI check
that validates - with the same underlying library as semantic-release -
whether a major release is being suggested, and if so, rejecting it.
Tested with: https://github.com/renovatebot/renovate/actions/runs/30451433399/job/90574167521?pr=44943#step:5:11
Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: