- introduce new configuration option, allowing to provide an empty_content for categories matching no PRs
- FIX https://github.com/mikepenz/release-changelog-builder-action/issues/804
This commit is contained in:
@@ -21,6 +21,7 @@ export interface Category {
|
||||
labels: string[] // labels to associate PRs to this category
|
||||
exclude_labels?: string[] // if an exclude label is detected, the PR will be excluded from this category
|
||||
exhaustive?: boolean // requires all labels to be present in the PR
|
||||
empty_content ?: string // if the category has no matching PRs, this content will be used. If not set, the category will be skipped in the changelog.
|
||||
}
|
||||
|
||||
export interface Sort {
|
||||
|
||||
+4
-3
@@ -183,9 +183,10 @@ export function buildChangelog(
|
||||
for (const pr of pullRequests) {
|
||||
changelog = `${changelog + pr}\n`
|
||||
}
|
||||
|
||||
// add space between
|
||||
changelog = `${changelog}\n`
|
||||
changelog = `${changelog}\n` // add space between sections
|
||||
} else if (category.empty_content !== undefined) {
|
||||
changelog = `${changelog + category.title}\n\n`
|
||||
changelog = `${changelog + category.empty_content}\n\n`
|
||||
}
|
||||
}
|
||||
core.info(`✒️ Wrote ${categorizedPrs.length} categorized pull requests down`)
|
||||
|
||||
Reference in New Issue
Block a user