File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 88 branches :
99 - main
1010 merge_group :
11- types :
12- - checks_requested
11+ branches :
12+ - main
1313
1414jobs :
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) }}'
You can’t perform that action at this time.
0 commit comments