Skip to content

Commit

Permalink
fix: commit messages in release notes
Browse files Browse the repository at this point in the history
Signed-off-by: Ar Rakin <[email protected]>
  • Loading branch information
virtual-designer committed Aug 29, 2024
1 parent 6585641 commit f87ac33
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35358,15 +35358,19 @@ class ChangeLogGenerator {
}
let headerAdded = false;
for (const commit of commits) {
const typeWithSubject = commit.message.match(/^([A-Za-z0-9-_](.*?))\!?:/);
const newLinePosition = commit.message.indexOf("\n");
const head = newLinePosition === -1
? commit.message
: commit.message.slice(0, newLinePosition);
const typeWithSubject = head.match(/^([A-Za-z0-9-_](.*?))\!?:/);
if (!typeWithSubject) {
continue;
}
if (!headerAdded) {
notes += `### ${ChangeLogGenerator.COMMIT_CLASSIFICATION[key]}\n`;
headerAdded = true;
}
notes += `* [[${commit.shortId}](https://github.com/${githubUsername}/${githubRepo}/commit/${commit.id})] **${typeWithSubject[1]}**: ${commit.message}\n`;
notes += `* [[${commit.shortId}](https://github.com/${githubUsername}/${githubRepo}/commit/${commit.id})] **${typeWithSubject[1]}**: ${head.replace(/^([A-Za-z0-9-_](.*?))\!?:/, "").trim()}\n`;
}
if (headerAdded) {
notes += "\n";
Expand Down

0 comments on commit f87ac33

Please sign in to comment.