Skip to content

Commit

Permalink
fix(makeReleaseNotes): include commit footers; closes #25
Browse files Browse the repository at this point in the history
  • Loading branch information
pskfyi committed May 2, 2023
1 parent b8df0ba commit 8afe653
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions git/script/makeReleaseNotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ function sortTypes(
}

function asListItem(
{ type, scope, description, body, breakingChange, hash }: CommitInfo,
groupByType: boolean,
{ type, scope, description, body, footers, breakingChange, hash }: CommitInfo,
groupByType?: boolean,
) {
const typeAndScope = groupByType
? scope ? `(${scope})` : ""
Expand All @@ -113,6 +113,14 @@ function asListItem(

if (body) listItem += `\n\n${indent(body, 2).replace(/^ +$/mg, "")}`;

if (footers?.length) {
const footersSegment = footers
.map(({ key, value }) => `${key}: ${value}`)
.join("\n\n");

listItem += `\n\n${indent(footersSegment, 2).replace(/^ +$/mg, "")}`;
}

return listItem;
}

Expand Down

0 comments on commit 8afe653

Please sign in to comment.