From 0a23897ae448f5257eeb2936cd176a4fbef121ec Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 2 Apr 2024 19:08:13 +0200 Subject: [PATCH] fix(changelog): make sure to always add body property to avoid errors !nuf --- bin/buildChangelog.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/buildChangelog.mjs b/bin/buildChangelog.mjs index 217b9372ce22..08a6b452504b 100644 --- a/bin/buildChangelog.mjs +++ b/bin/buildChangelog.mjs @@ -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, @@ -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); } } @@ -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: "", }); } @@ -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: "", }); }