Skip to content

Commit

Permalink
fix(changelog): make sure to always add body property to avoid errors
Browse files Browse the repository at this point in the history
!nuf
  • Loading branch information
Miodec committed Apr 2, 2024
1 parent 254e016 commit 0a23897
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/buildChangelog.mjs
Expand Up @@ -239,7 +239,9 @@ function convertStringToLog(logString) {
// /(\w{40}) (\w{9,10}) (.*)/
// );

const [hash, shortHash, title, body] = line.split(logDelimiter);
const [hash, shortHash, title, body] = line
.split(logDelimiter)
.map((s) => s.trim());

// console.log({
// hash,
Expand Down Expand Up @@ -276,11 +278,12 @@ function convertStringToLog(logString) {
type,
scope,
message,
usernames,
usernames: usernames || [],
prs,
body,
body: body || "",
});
} else {
console.log({ hash, shortHash, title, body });
console.warn("skipping line due to invalid format: " + line);
}
}
Expand Down Expand Up @@ -362,6 +365,7 @@ async function main() {
message: "add quotes in various languages",
usernames: quoteAddCommits.map((item) => item.usernames).flat(),
prs: quoteAddCommits.map((item) => item.prs).flat(),
body: "",
});
}

Expand All @@ -373,6 +377,7 @@ async function main() {
message: "update or remove quotes reported by users",
usernames: quoteReportCommits.map((item) => item.usernames).flat(),
prs: quoteReportCommits.map((item) => item.prs).flat(),
body: "",
});
}

Expand Down

0 comments on commit 0a23897

Please sign in to comment.