From ff2392aa0d94f4250ed611321010ef94851489f7 Mon Sep 17 00:00:00 2001 From: anthonylaye Date: Fri, 17 Jun 2022 10:19:20 +0200 Subject: [PATCH] keep the or case in an else block at the end --- src/add-to-project.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/add-to-project.ts b/src/add-to-project.ts index c2edd2d..d57165d 100644 --- a/src/add-to-project.ts +++ b/src/add-to-project.ts @@ -50,16 +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 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 } + } else { + 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 + } } core.debug(`Project URL: ${projectUrl}`)