Skip to content

Commit 1dff477

Browse files
committed
Add a success job to CI for branch protection
1 parent 9bd1af8 commit 1dff477

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/rust.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,17 @@ jobs:
4949
rustup update --no-self-update
5050
5151
- run: cargo build
52+
53+
success:
54+
needs:
55+
- test
56+
- msrv
57+
runs-on: ubuntu-latest
58+
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
59+
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
60+
# dependencies fails.
61+
if: always() # make sure this is never "skipped"
62+
steps:
63+
# Manually check the status of all dependencies. `if: failure()` does not work.
64+
- name: check if any dependency failed
65+
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)