Skip to content

Commit f898add

Browse files
committed
option to disable empty sections
1 parent e3ecd03 commit f898add

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ exports.NODE_ENV = process.env.NODE_ENV;
88

99
// will looks for issues closed this many seconds after the tag, this may happen if the issue is merged via a MR and automatially closed
1010
// example -e GITLAB_ISSUE_SECOND_DELAY=60 will catch issues closed up to 60 seconds after the tag is created.
11-
exports.ISSUE_CLOSED_SECONDS = process.env.ISSUE_CLOSED_SECONDS || "0";
11+
exports.ISSUE_CLOSED_SECONDS = process.env.ISSUE_CLOSED_SECONDS || "0";
12+
exports.RENDER_EMPTY_SECTIONS = process.env.RENDER_EMPTY_SECTIONS === "false" ? false : true;

app/lib/changelog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.generateChangeLogContent = async ({ releaseDate, issues, mergeRequests }
4646
let changelogContent = `### Release note (${Moment.tz(releaseDate, Env.TZ).format("YYYY-MM-DD")})\n`;
4747
for (const labelConfig of labelConfigs) {
4848
if (changelogBucket[labelConfig.name]) {
49-
if (!_.isEmpty(changelogBucket[labelConfig.name]) || labelConfig.default) {
49+
if (!_.isEmpty(changelogBucket[labelConfig.name]) || (labelConfig.default && Env.RENDER_EMPTY_SECTIONS)) {
5050
changelogContent += `#### ${labelConfig.title}\n`;
5151
if (!_.isEmpty(changelogBucket[labelConfig.name])) changelogContent += changelogBucket[labelConfig.name].join("\n") + "\n";
5252
}

0 commit comments

Comments
 (0)