File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -233,19 +233,25 @@ jobs:
233
233
run : rustup update nightly && rustup default nightly
234
234
- run : ./ci/build-std-detect.sh
235
235
236
- success :
236
+ conclusion :
237
237
needs :
238
238
- docs
239
239
- verify
240
240
- env_override
241
241
- test
242
242
- build-std-detect
243
243
runs-on : ubuntu-latest
244
- # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
245
- # failed" as success. So we have to do some contortions to ensure the job fails if any of its
246
- # dependencies fails.
247
- if : always() # make sure this is never "skipped"
244
+ # We need to ensure this job does *not* get skipped if its dependencies fail,
245
+ # because a skipped job is considered a success by GitHub. So we have to
246
+ # overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
247
+ # when the workflow is canceled manually.
248
+ #
249
+ # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
250
+ if : ${{ !cancelled() }} # make sure this is never "skipped"
248
251
steps :
249
- # Manually check the status of all dependencies. `if: failure()` does not work.
250
- - name : check if any dependency failed
251
- run : jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
252
+ - name : Conclusion
253
+ run : |
254
+ # Print the dependent jobs to see them in the CI log
255
+ jq -C <<< '${{ toJson(needs) }}'
256
+ # Check if all jobs that we depend on (in the needs array) were successful.
257
+ jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
You can’t perform that action at this time.
0 commit comments