Skip to content

Commit f854d1a

Browse files
committed
build: show features before bug fixes in releases
1 parent 6e33a4f commit f854d1a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.releaserc.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,23 @@ const config: Omit<GlobalConfig, "repositoryUrl" | "tagFormat"> = {
5252
}],
5353
["@semantic-release/release-notes-generator", {
5454
writerOpts: {
55-
footerPartial: newFooterTemplate
55+
footerPartial: newFooterTemplate,
56+
57+
// ensure that the "Features" group comes before the "Bug Fixes" group
58+
commitGroupsSort(a: {title: string}, b: {title: string}) {
59+
const order = ["Features", "Bug Fixes"];
60+
const aIndex = order.indexOf(a?.title);
61+
const bIndex = order.indexOf(b?.title);
62+
63+
if (aIndex >= 0 && bIndex >= 0)
64+
return aIndex - bIndex;
65+
else if (aIndex >= 0)
66+
return -1;
67+
else if (bIndex >= 0)
68+
return 1;
69+
70+
return (a?.title || "").localeCompare(b?.title || "");
71+
}
5672
}
5773
}],
5874
["@semantic-release/exec", {

0 commit comments

Comments
 (0)