From 477c71427dc1d03e0f3dced0d65bd7c1b99fd900 Mon Sep 17 00:00:00 2001 From: Dmitriy Mozgovoy Date: Mon, 9 Jan 2023 17:10:14 +0200 Subject: [PATCH] chore(ci): fixed error in generating changelog with unnecessary spaces; (#5455) --- bin/injectContributorsList.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/injectContributorsList.js b/bin/injectContributorsList.js index 92accf7..2b25c59 100644 --- a/bin/injectContributorsList.js +++ b/bin/injectContributorsList.js @@ -46,6 +46,10 @@ const injectSection = async (name, contributorsRE, injector, infile = '../CHANGE const section = await injector(target); + if (!section) { + return match; + } + console.log(colorize()`\nRENDERED SECTION [${name}] for [${currentTag}]:`); console.log('-------------BEGIN--------------\n'); console.log(section); @@ -64,7 +68,7 @@ const injectSection = async (name, contributorsRE, injector, infile = '../CHANGE await injectSection( 'PRs', /^\s*### PRs/mi, - (tag) => !tag && renderPRsList(tag, PRS_TEMPLATE, {awesome_threshold: 5, comments_threshold: 7}), + (tag) => tag ? '' : renderPRsList(tag, PRS_TEMPLATE, {awesome_threshold: 5, comments_threshold: 7}), ); await injectSection(