Skip to content

Commit fd811c5

Browse files
fix(repo): More robust hasMajorChangeset check (#6310)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 53983db commit fd811c5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/major-version-check.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ jobs:
5555
5656
const content = Buffer.from(changesetContent.content, changesetContent.encoding).toString();
5757
58-
if (/major/.test(content)) {
59-
hasMajorChangeset = true;
60-
break;
58+
// Only check for "major" in the YAML frontmatter section (between --- markers)
59+
// This avoids false positives from descriptive text mentioning "major"
60+
const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\s*$/m);
61+
if (frontmatterMatch) {
62+
const frontmatter = frontmatterMatch[1];
63+
if (/:\s*["']?major["']?/.test(frontmatter)) {
64+
hasMajorChangeset = true;
65+
break;
66+
}
6167
}
6268
}
6369
}

0 commit comments

Comments
 (0)