Skip to content

Commit d5f5b74

Browse files
committed
CI: Switch to merge queue
1 parent 1d2b1f0 commit d5f5b74

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: CI
2-
on: [push, pull_request]
2+
on:
3+
pull_request:
4+
merge_group:
35

46
env:
57
MDBOOK_VERSION: 0.4.40
@@ -34,3 +36,19 @@ jobs:
3436
curl -sSLo linkcheck.sh \
3537
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
3638
sh linkcheck.sh --all edition-guide
39+
40+
# The success job is here to consolidate the total success/failure state of
41+
# all other jobs. This job is then included in the GitHub branch protection
42+
# rule which prevents merges unless all other jobs are passing. This makes
43+
# it easier to manage the list of jobs via this yml file and to prevent
44+
# accidentally adding new jobs without also updating the branch protections.
45+
success:
46+
name: Success gate
47+
if: always()
48+
needs:
49+
- test
50+
runs-on: ubuntu-latest
51+
steps:
52+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
53+
- name: Done
54+
run: exit 0

0 commit comments

Comments
 (0)