Skip to content

Commit 39add42

Browse files
authored
Add complexity0, er, and epic to labels to exclude for check (#8598)
* Add complexity0, er, and epic to labels to exclude for check * fix typo: includes()
1 parent 7036f95 commit 39add42

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

github-actions/check-closed-issue-for-linked-pr/check-for-linked-issue/check-issue-labels-and-linked-prs.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ const retrieveLabelDirectory = require('../../utils/retrieve-label-directory');
22

33
// Use labelKeys to retrieve current labelNames from directory
44
const [
5-
nonPrContribution
5+
nonPrContribution,
6+
complexity0,
7+
er,
8+
epic
69
] = [
7-
'NEW-nonPrContribution'
10+
'NEW-nonPrContribution',
11+
'complexity0',
12+
'er',
13+
'epic'
814
].map(retrieveLabelDirectory);
915

1016
// ==================================================
@@ -15,8 +21,9 @@ const [
1521
*
1622
* @param {{github: object, context: object}} actionsGithubScriptArgs - GitHub
1723
* objects from actions/github-script
18-
* @returns {boolean} False if the issue does not have a linked PR, a "non-PR
19-
* contribution" label, or an "Ignore..." label.
24+
* @returns {boolean} False if the issue does not have a linked PR, one of the following contribution labels: "non-PR
25+
* contribution", "Complexity: Prework", "ER", "epic", or an
26+
* "Ignore..." label.
2027
*/
2128
async function hasLinkedPrOrExcusableLabel({ github, context }) {
2229
const repoOwner = context.repo.owner;
@@ -31,10 +38,12 @@ async function hasLinkedPrOrExcusableLabel({ github, context }) {
3138
// --------------------------------------------------
3239

3340
// Check if the issue has the labels that will avoid re-opening it.
41+
const excludedLabels = [nonPrContribution, complexity0, er, epic];
42+
3443
if (
3544
labels.some(
3645
(label) =>
37-
label === nonPrContribution || label.toLowerCase().includes('ignore')
46+
excludedLabels.includes(label) || label.toLowerCase().includes('ignore')
3847
)
3948
) {
4049
console.info(consoleMessageAllowClose);

0 commit comments

Comments
 (0)