Skip to content

Commit cadd9b4

Browse files
committed
ci(repo): support merge queue and re-run PR title check on push
Two branch-protection robustness fixes: - Add the merge_group trigger to ci.yml and check-pr.yml so the required CI and "Conventional commit PRs" checks report on the merge queue's speculative merge commit. Without it the queue never sees the checks and stalls. The event-gated ci.yml jobs (quality checks, build, workspace tests) now also run on merge_group so the queue exercises real coverage, not a hollow green. The PR-title job is skipped on merge_group (no PR context); the aggregator still reports success via the allowed-skip path. - Add synchronize to check-pr.yml so the title check re-runs on every pushed commit. Otherwise a required title check strands as "Expected" on the new head commit after a push.
1 parent d17dc5c commit cadd9b4

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/check-pr.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ on:
66
- opened
77
- edited
88
- reopened
9+
# Required-check safety: re-run on every push so the check stamps each new
10+
# head commit, otherwise a required title check gets stuck "Expected".
11+
- synchronize
12+
# Merge queue: the workflow must run on merge_group so the required
13+
# "Conventional commit PRs" check reports on the queue's merge commit.
14+
merge_group:
915

1016
jobs:
1117
main:
1218
name: Validate PR title
19+
# No PR context in a merge_group event, and the title was already validated
20+
# before the PR entered the queue. Skip here - the aggregator below still
21+
# reports success (a skipped need is allowed), satisfying the required check.
22+
if: github.event_name != 'merge_group'
1323
runs-on: ubuntu-latest
1424
permissions:
1525
pull-requests: read

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77
pull_request:
8+
# Merge queue: required checks must report on the queue's speculative merge
9+
# commit, which arrives via the merge_group event (not pull_request).
10+
merge_group:
811
workflow_dispatch:
912

1013
env:
@@ -125,7 +128,7 @@ jobs:
125128
runs-on: ubuntu-latest
126129
# Run always on PRs to main, or if determine-changes says something relevant changed on push to main.
127130
# This ensures quality checks run even if no "package" code changed but e.g. a workflow file did.
128-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
131+
if: github.event_name == 'pull_request' || github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
129132
steps:
130133
- name: Checkout code
131134
uses: actions/checkout@v4
@@ -159,7 +162,7 @@ jobs:
159162
quality-checks-rust:
160163
name: Global Quality Checks (Rust)
161164
runs-on: ubuntu-latest
162-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
165+
if: github.event_name == 'pull_request' || github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
163166
steps:
164167
- name: Checkout code
165168
uses: actions/checkout@v4
@@ -184,7 +187,7 @@ jobs:
184187
name: Build grz-check Binary
185188
needs: [ quality-checks-rust ]
186189
runs-on: ubuntu-latest
187-
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
190+
if: github.event_name == 'pull_request' || github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
188191
steps:
189192
- name: Checkout code
190193
uses: actions/checkout@v4
@@ -242,7 +245,7 @@ jobs:
242245
python-version:
243246
- "3.12"
244247
- "3.13"
245-
if: ${{ !cancelled() && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && needs.build-grz-check-binary.result == 'success' && (needs.test-changed-packages-rust.result == 'success' || needs.test-changed-packages-rust.result == 'skipped') }}
248+
if: ${{ !cancelled() && (github.event_name == 'pull_request' || github.event_name == 'merge_group' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && needs.build-grz-check-binary.result == 'success' && (needs.test-changed-packages-rust.result == 'success' || needs.test-changed-packages-rust.result == 'skipped') }}
246249
steps:
247250
- name: Checkout code
248251
uses: actions/checkout@v4

0 commit comments

Comments
 (0)