From fcb780e2b56d3f840f37f857a43eb6f24f3efdf8 Mon Sep 17 00:00:00 2001 From: anthonylaye Date: Thu, 16 Jun 2022 17:27:06 +0200 Subject: [PATCH] Add new option for excluding issues with certain labels --- src/add-to-project.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/add-to-project.ts b/src/add-to-project.ts index 19c6715..4a2d11d 100644 --- a/src/add-to-project.ts +++ b/src/add-to-project.ts @@ -50,11 +50,16 @@ export async function addToProject(): Promise { core.info(`Skipping issue ${issue?.number} because it doesn't match all the labels: ${labeled.join(', ')}`) return } - } else { + } else if (labelOperator === 'or') { if (labeled.length > 0 && !issueLabels.some(l => labeled.includes(l))) { core.info(`Skipping issue ${issue?.number} because it does not have one of the labels: ${labeled.join(', ')}`) return } + } else if (labelOperator === 'not') { + if (labeled.length > 0 && issueLabels.some(l => labeled.includes(l))) { + core.info(`Skipping issue $(issue?.number} because it contains one of the labels: $(labeled.join(', ')}`) + return + } } core.debug(`Project URL: ${projectUrl}`)