Skip to content

Commit

Permalink
keep the or case in an else block at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLaye committed Jun 17, 2022
1 parent d0b7876 commit ff2392a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/add-to-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ export async function addToProject(): Promise<void> {
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}`)
Expand Down

0 comments on commit ff2392a

Please sign in to comment.