Skip to content

Commit b67396c

Browse files
authored
ci: align detector with release-it parser semantics (#353)
1 parent d629f11 commit b67396c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tools/detect-breaking-commits.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ const TRACKED_PATHS = [
2727
"packages/shared",
2828
];
2929

30-
// Conventional Commits breaking-change markers:
31-
// 1. `type!:` or `type(scope)!:` in the subject line
32-
// 2. `BREAKING CHANGE:` or `BREAKING-CHANGE:` footer line
30+
// Matches what `conventional-changelog-conventionalcommits` (used by
31+
// release-it) treats as a major-bumping breaking change. Verified against
32+
// the live parser; covers:
33+
// - Subject `type!:` / `type(scope)!:` (case-insensitive)
34+
// - Footer line `BREAKING CHANGE` or `BREAKING-CHANGE`, with optional
35+
// leading whitespace, optional colon, case-insensitive
36+
// Excludes the plural `BREAKING CHANGES` (parser does NOT treat it as
37+
// breaking — `\b(?!S)` enforces this) and mid-line / list-item occurrences.
3338
const BREAKING_PATTERN =
34-
/^(feat|fix|chore|refactor|perf|build|ci|docs|style|test|revert)(\([^)]+\))?!:|^BREAKING[ -]CHANGE:/m;
39+
/^(feat|fix|chore|refactor|perf|build|ci|docs|style|test|revert)(\([^)]+\))?!:|^\s*BREAKING[ -]CHANGE\b(?!S)/im;
3540

3641
function requireEnv(name: string): string {
3742
const value = process.env[name];

0 commit comments

Comments
 (0)