Skip to content

Commit 4070b34

Browse files
chore: message type detection in release notes script
1 parent 8748d9b commit 4070b34

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

utils/scripts/generate-release-notes.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,16 @@ function categorizeCommits(commits, { mergeOnly, importantOnly }) {
118118
if (mergeOnly && !isMerge) continue;
119119

120120
const type =
121-
Object.keys(sections).find(
122-
(k) =>
123-
msg.toLowerCase().startsWith(`${k}:`) ||
124-
msg.toLowerCase().startsWith(`${k} `),
125-
) || "other";
121+
Object.keys(sections).find((k) => {
122+
const lowerMsg = msg.toLowerCase();
123+
return (
124+
lowerMsg.startsWith(`${k}:`) ||
125+
lowerMsg.startsWith(`${k} `) ||
126+
lowerMsg.startsWith(`${k}(`) ||
127+
lowerMsg.startsWith(`${k}: `) ||
128+
lowerMsg.startsWith(`${k}(`) // handles e.g. 'feat(plugin-api): ...'
129+
);
130+
}) || "other";
126131

127132
if (
128133
importantOnly &&

0 commit comments

Comments
 (0)