fix(ci): a diff is a release only when it bumps versions (#8355)

* test(ci): a fix to an earlier release's notes is not a release

* fix(ci): a diff is a release only when it bumps versions
This commit is contained in:
Miguel Ángel
2026-11-21 06:59:15 +00:00
committed by GitHub
parent a744f5c3f5
commit de63e97311
2 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ export function classify(paths, before, after) {
if (bumped === null) other.push(path);
else versions.set(path, bumped);
}
return { releaseOnly: paths.length > 0 && other.length === 0, other, versions };
return { releaseOnly: versions.size > 0 && other.length === 0, other, versions };
}
/** The commits in `commits` ({ sha, subject }) that release notes should list but do not link. */
+13
View File
@@ -213,6 +213,19 @@ test("the merge queue runs the release checks on a release diff", () => {
assert.match(ci, /release-checks:[\s\S]*merge_group[\s\S]*release_diff/);
});
// fails without the fix: a fix to an earlier release's notes counted as a release, so its checks wanted a bump.
test("a diff of only release notes and the changelog is a notes fix, not a release", () => {
const files = { "releases/v1.2.3.md": "# old", "docs/changelog.mdx": "old" };
const after = { "releases/v1.2.3.md": "# new", "docs/changelog.mdx": "new" };
const result = classify(
Object.keys(files),
(p) => files[p] ?? null,
(p) => after[p] ?? null,
);
assert.equal(result.releaseOnly, false);
assert.equal(result.versions.size, 0);
});
test("classify works on plain data", () => {
const files = { "a/package.json": manifest("1"), "plugin.json": manifest("1") };
const after = { "a/package.json": manifest("2"), "plugin.json": manifest("2") };