- add new ability to define exclude_labels for categories (give greater flexibility)

- FIX https://github.com/mikepenz/release-changelog-builder-action/issues/681
This commit is contained in:
Mike Penz
2022-02-11 11:12:39 +01:00
parent 0b69e37c22
commit a0a47047d6
4 changed files with 34 additions and 1 deletions
+20
View File
@@ -111,6 +111,26 @@ export function buildChangelog(
let matched = false
for (const [category, pullRequests] of categorized) {
// check if any exclude label matches
if (category.exclude_labels !== undefined) {
if (
haveCommonElements(
category.exclude_labels.map(lbl => lbl.toLocaleLowerCase('en')),
pr.labels
)
) {
if (core.isDebug()) {
const prNum = pr.number
const prLabels = pr.labels
const excludeLabels = JSON.stringify(category.exclude_labels)
core.debug(
`PR ${prNum} with labels: ${prLabels} excluded from category via exclude label: ${excludeLabels}`
)
}
continue // one of the exclude labels matched, skip the PR for this category
}
}
if (category.exhaustive === true) {
if (
haveEveryElements(