Skip to content

Commit 40cca4b

Browse files
committed
Add warning for only ignore label. Fail on missing labels
1 parent 4f6ca0b commit 40cca4b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Dangerfile.df.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import systems.danger.kotlin.*
44

55
danger(args) {
66
onGitHub {
7-
if (issue.labels.isEmpty()) {
8-
warn("PR must have labels")
7+
val prLabels = issue.labels
8+
when (prLabels.size) {
9+
0 -> fail("PR must have labels")
10+
1 ->
11+
prLabels.find { it.name.equals("ignore", ignoreCase = true) }?.let {
12+
warn("PR must have labels other than 'ignore'")
13+
}
14+
else -> {}
915
}
1016
}
1117
}

0 commit comments

Comments
 (0)