Skip to content

Commit d458634

Browse files
committed
ci: Add a meta job to block the merge queue on it.
1 parent 77d17a0 commit d458634

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/cbindgen.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ on:
88
branches:
99
- main
1010
merge_group:
11-
types:
12-
- checks_requested
11+
branches:
12+
- main
1313

1414
jobs:
1515
rustfmt-clippy:
16-
1716
runs-on: ubuntu-24.04
1817

1918
steps:
@@ -121,4 +120,18 @@ jobs:
121120
- name: Test minimal-versions
122121
run: |
123122
cargo +nightly update -Zminimal-versions
124-
cargo +nightly test
123+
124+
# One job that "summarizes" the success state of this pipeline. This can then
125+
# be added to branch protection, rather than having to add each job
126+
# separately.
127+
success:
128+
runs-on: ubuntu-24.04
129+
needs: [rustfmt-clippy, build]
130+
# GitHub branch protection is exceedingly silly and treats "jobs skipped
131+
# because a dependency failed" as success. So we have to do some
132+
# contortions to ensure the job fails if any of its dependencies fails.
133+
if: always() # make sure this is never "skipped"
134+
steps:
135+
# Manually check the status of all dependencies. `if: failure()` does not work.
136+
- name: check if any dependency failed
137+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)