mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
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:
@@ -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. */
|
||||
|
||||
@@ -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") };
|
||||
|
||||
Reference in New Issue
Block a user