Merge pull request #1181 from mikepenz/fix/1178
Respect `exclude_label` for `uncategorized` category definition
This commit is contained in:
+14
-1
@@ -627,10 +627,23 @@ function buildChangelog(diffInfo, origPrs, options) {
|
|||||||
// we allow to have pull requests included in an "uncategorized" category
|
// we allow to have pull requests included in an "uncategorized" category
|
||||||
for (const [category, pullRequests] of categorized) {
|
for (const [category, pullRequests] of categorized) {
|
||||||
if ((category.labels === undefined || category.labels.length === 0) && category.rules === undefined) {
|
if ((category.labels === undefined || category.labels.length === 0) && category.rules === undefined) {
|
||||||
pullRequests.push(body);
|
// check if any exclude label matches for the "uncategorized" category
|
||||||
|
if (category.exclude_labels !== undefined) {
|
||||||
|
if (!(0, utils_1.haveCommonElementsArr)(category.exclude_labels.map(lbl => lbl.toLocaleLowerCase('en')), pr.labels)) {
|
||||||
|
pullRequests.push(body);
|
||||||
|
}
|
||||||
|
else if (core.isDebug()) {
|
||||||
|
const excludeLabels = JSON.stringify(category.exclude_labels);
|
||||||
|
core.debug(` PR ${pr.number} with labels: ${pr.labels} excluded from uncategorized category via exclude label: ${excludeLabels}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pullRequests.push(body);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// note the `exclude label` configuration of categories will not apply to the legacy "UNCATEGORIZED" placeholder
|
||||||
uncategorizedPrs.push(body);
|
uncategorizedPrs.push(body);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+21
-1
@@ -228,10 +228,30 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
|
|||||||
// we allow to have pull requests included in an "uncategorized" category
|
// we allow to have pull requests included in an "uncategorized" category
|
||||||
for (const [category, pullRequests] of categorized) {
|
for (const [category, pullRequests] of categorized) {
|
||||||
if ((category.labels === undefined || category.labels.length === 0) && category.rules === undefined) {
|
if ((category.labels === undefined || category.labels.length === 0) && category.rules === undefined) {
|
||||||
pullRequests.push(body)
|
// check if any exclude label matches for the "uncategorized" category
|
||||||
|
if (category.exclude_labels !== undefined) {
|
||||||
|
if (
|
||||||
|
!haveCommonElementsArr(
|
||||||
|
category.exclude_labels.map(lbl => lbl.toLocaleLowerCase('en')),
|
||||||
|
pr.labels
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
pullRequests.push(body)
|
||||||
|
} else if (core.isDebug()) {
|
||||||
|
const excludeLabels = JSON.stringify(category.exclude_labels)
|
||||||
|
core.debug(
|
||||||
|
` PR ${pr.number} with labels: ${pr.labels} excluded from uncategorized category via exclude label: ${excludeLabels}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pullRequests.push(body)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// note the `exclude label` configuration of categories will not apply to the legacy "UNCATEGORIZED" placeholder
|
||||||
uncategorizedPrs.push(body)
|
uncategorizedPrs.push(body)
|
||||||
} else {
|
} else {
|
||||||
categorizedPrs.push(body)
|
categorizedPrs.push(body)
|
||||||
|
|||||||
Reference in New Issue
Block a user