ci: detect breaking-change commits in PRs#350
Merged
MarioCadenas merged 3 commits intomainfrom May 6, 2026
Merged
Conversation
atilafassina
approved these changes
May 6, 2026
0de2b5f to
fe49bf2
Compare
Adds a workflow that scans every commit in a pull request for Conventional Commits breaking-change markers (`type!:` or `BREAKING CHANGE:` footer) limited to the packages tracked by .release-it.json (appkit, appkit-ui, shared). When a breaking commit is found, the job posts a sticky PR comment explaining the major-version impact and fails the check, unless the PR carries an `allow-breaking-change` label. This prevents accidental major bumps from landing on main once the new check is added to branch-protection required checks. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
fe49bf2 to
85f7249
Compare
pkosiec
reviewed
May 6, 2026
pkosiec
reviewed
May 6, 2026
…ctor in TS Addresses review feedback on #350: - Merge `pr-title.yml` and `pr-breaking-change.yml` into a single `pr-metadata.yml` workflow ("PR Metadata Verification") with two jobs: `check-title` and `detect-breaking`. - Move the breaking-commit scan from a bash script to `tools/detect-breaking-commits.ts`, matching the rest of `tools/*.ts`. - Run the TS script directly with `node` (Node 24 native type stripping) so the job stays lightweight — no pnpm install or tsx transpile step.
The previous detector only walked per-commit messages, so a PR with a title like `feat!: foo` or with `BREAKING CHANGE:` in the description would slip through even though both surfaces feed `release-it` after a squash merge (title becomes the squash subject, description can land in the squash body). Pass `PR_TITLE` and `PR_BODY` into the detector and group hits by source (title / description / commits) in the sticky PR comment.
pkosiec
approved these changes
May 6, 2026
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
Adds a breaking-change detector to the existing PR metadata workflow. Every commit in a PR is scanned for Conventional Commits breaking-change markers, and the merge is gated.
pr-title.yml→pr-metadata.yml(workflow namePR Metadata Verification) and addsdetect-breakingas a second job alongside the existing title check.git rev-list base..headover the paths tracked by.release-it.json(packages/appkit,packages/appkit-ui,packages/shared) so docs/tooling-only commits don't trigger noise.tools/detect-breaking-commits.ts(TS, run withnodevia Node 24's native type stripping — no extra install/transpile step), consistent with the rest oftools/*.ts.feat!:,feat(scope)!:, etc. across all conventional types) andBREAKING CHANGE:/BREAKING-CHANGE:footers.actions/github-script@v7.0.1(identified by an HTML-comment marker so re-runs update/remove the same comment).allow-breaking-changelabel, providing an explicit escape hatch for intentional major bumps.Today,
.release-it.jsonhasbumpStrict: true, so a singleBREAKING CHANGE:orfeat!commit landing onmainsilently forces a major version on the next release. This check makes that visible at PR time.Follow-ups (not in this PR)
mainbranch protection required status checks: the previousPR Title / Conventional Commit Titlecheck is nowPR Metadata Verification / Conventional Commit Title, and addPR Metadata Verification / Detect Breaking Commitsso the merge button is actually blocked.allow-breaking-changelabel so reviewers can opt in when a major bump is intentional.mainis configured for squash merge, the per-commit messages are discarded on merge andrelease-itonly sees the squash commit (already covered by the title check); in that case this check is informational. With merge commit or rebase merge strategies, the check is load-bearing.Test plan
PR Metadata Verificationand the breaking-change job reports "no breaking commits found" (no comment posted, job green).feat(appkit)!: test breaking markertouchingpackages/appkit/**and verify:allow-breaking-changelabel re-runs the workflow and turns it green; comment updates to acknowledge the intentional bump.feat!:touchingdocs/**only and confirm the check stays green (path filter working).