Skip to content

Commit

Permalink
Update ignore labels condition
Browse files Browse the repository at this point in the history
Signed-off-by: KeisukeYamashita <[email protected]>
  • Loading branch information
KeisukeYamashita committed Jan 16, 2021
1 parent c1eef46 commit 8e0de2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/merger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export class Merger {
if (type === 'labels' && hasLabels.length === labels.length) {
failed = false
}
if (type === 'ignoreLabels' && hasLabels.length) {
if (type === 'ignoreLabels' && !hasLabels.length) {
failed = false
}

core.debug(
`Checked all labels for type:${type} and prLabels:${inspect(
`Checking all labels for type:${type} and prLabels:${inspect(
pr.labels.map(l => l.name)
)}, hasLabels:${inspect(hasLabels)}, labels:${inspect(
labels
Expand Down Expand Up @@ -94,12 +94,12 @@ export class Merger {
if (type === 'labels' && hasLabels.length) {
failed = false
}
if (type === 'ignoreLabels' && hasLabels.length) {
if (type === 'ignoreLabels' && !hasLabels.length) {
failed = false
}

core.debug(
`Checked atLeastOne labels for type:${type} and prLabels:${inspect(
`Checking atLeastOne labels for type:${type} and prLabels:${inspect(
pr.labels.map(l => l.name)
)}, hasLabels:${inspect(hasLabels)}, labels:${inspect(
labels
Expand Down Expand Up @@ -160,7 +160,7 @@ export class Merger {
`Checked labels and passed with message:${labelResult.message} with ${this.cfg.labelsStrategy}`
)
core.info(
`Checked labels and passed with ignoreLabels:${inspect(
`Checked labels and passed with labels:${inspect(
this.cfg.labels
)}`
)
Expand Down

0 comments on commit 8e0de2f

Please sign in to comment.