Skip to content

Commit de9505c

Browse files
authored
CI - Label check always runs (#4594)
# Description of Changes The CI check for the Do Not Merge label was only running on label-change events, so if a PR never received a label (any label), the check would never run. This meant that the check couldn't be marked required because it was missing on PRs that were never labeled anything. Additionally, the check was not configured to run properly in the merge queue, so it would have blocked the merge queue if it were a required check. This PR fixes those issues by making the check run on more pull request events, and by trivially succeeding in the merge queue. This enables the check to be made required. # API and ABI breaking changes None. CI only. # Expected complexity level and risk 1 # Testing - [x] The check is now showing as run on this PR - [x] The check still fails if I add a "do not merge" label --------- Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
1 parent b391d73 commit de9505c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/check-merge-labels.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ name: Check merge labels
22

33
on:
44
pull_request:
5-
types: [labeled, unlabeled]
5+
types: [opened, reopened, labeled, unlabeled]
66
merge_group:
7+
78
permissions: read-all
89

910
jobs:
1011
label_checks:
12+
name: Check merge labels
1113
runs-on: ubuntu-latest
1214
steps:
13-
- id: manually_blocked
14-
if: |
15-
contains(github.event.pull_request.labels.*.name, 'do not merge')
15+
- if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'do not merge')
1616
run: |
1717
echo "This is labeled \"Do not merge\"."
1818
exit 1
19+
20+
# If we're in a merge queue, the PR has already passed checks these checks before being added to the queue.
21+
- if: github.event_name == 'merge_group'
22+
run: echo "Merge group run; skipping merge-label checks."

0 commit comments

Comments
 (0)