Skip to content

Commit b1be6d7

Browse files
committed
ci: Enable merge queue support
Add the merge_group event trigger so CI runs when a pull request enters the GitHub merge queue. Also align the required-checks sentinel to use the standard jq-based pattern (success-or-skipped) so that jobs which are intentionally skipped in some contexts don't accidentally block the queue. xref: bootc-dev/infra#143 Assisted-by: OpenCode (Claude Sonnet 4.6) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent e3907b1 commit b1be6d7

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
pull_request:
77
branches: [ main ]
88
workflow_dispatch:
9+
merge_group:
910

1011
env:
1112
# Something seems to be setting this in the default GHA runners, which breaks bcvk
1213
# as the default runner user doesn't have access
1314
LIBVIRT_DEFAULT_URI: "qemu:///session"
1415

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
1519

1620
jobs:
1721
build-macos:
@@ -192,14 +196,20 @@ jobs:
192196
path: target/nextest/integration/junit.xml
193197
retention-days: 7
194198

195-
# Sentinel job for required checks - configure this job name in repository settings
199+
# Sentinel job for required checks - configure this job name in repository settings.
200+
# Accepts 'skipped' as success so that merge_group-only jobs don't block PRs.
196201
required-checks:
197202
if: always()
198203
needs: [build-macos, build, integration-tests]
199204
runs-on: ubuntu-latest
200205
steps:
201-
- run: exit 1
202-
if: >-
203-
needs.build-macos.result != 'success' ||
204-
needs.build.result != 'success' ||
205-
needs.integration-tests.result != 'success'
206+
- name: Check all jobs
207+
env:
208+
NEEDS: ${{ toJson(needs) }}
209+
run: |
210+
FAILED=$(echo "$NEEDS" | jq -r 'to_entries[] | select(.value.result | IN("success","skipped") | not) | .key')
211+
if [ -n "$FAILED" ]; then
212+
echo "The following jobs did not succeed: $FAILED"
213+
exit 1
214+
fi
215+
echo "All jobs succeeded or were skipped."

0 commit comments

Comments
 (0)