Skip to content

Commit 25c636c

Browse files
feat(ci): Improve failure message (#10547)
feat(ci): Improve failure message Co-authored-by: bruce.bujon <bruce.bujon@datadoghq.com>
1 parent 494fd6b commit 25c636c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/check-pull-request-labels.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
'**This PR is blocked until:**\n' +
5757
'1. The invalid labels are deleted, and\n' +
5858
'2. A maintainer deletes this comment to unblock the PR\n\n' +
59-
'**Note:** Simply removing labels from the pull request is not enough - a maintainer must remove the label and delete this comment to remove the block.\n\n' +
59+
'**Note:** Simply removing labels from the pull request is not enough - a maintainer must delete this comment then remove the label to remove the block.\n\n' +
6060
commentMarker
6161
6262
if (blockingComment) {
@@ -80,5 +80,9 @@ jobs:
8080
}
8181
if (blockingComment) {
8282
// Block the PR by failing the workflow
83-
core.setFailed(`PR blocked: Invalid labels detected: (${invalidLabels.join(', ')}). A maintainer must delete the blocking comment after fixing the labels to allow merging.`)
83+
if (hasInvalidLabels) {
84+
core.setFailed(`PR blocked: Invalid labels detected: (${invalidLabels.join(', ')}). A maintainer must delete the blocking comment after fixing the labels to allow merging.`)
85+
} else {
86+
core.setFailed(`PR blocked: A previous blocking comment still exists. A maintainer must delete it to allow merging.`)
87+
}
8488
}

0 commit comments

Comments
 (0)