Skip to content

Commit 9ebe68d

Browse files
committed
Add conclusion job to PR CI
1 parent 3338611 commit 9ebe68d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/clippy_pr.yml

+21
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,24 @@ jobs:
6262
run: .github/driver.sh
6363
env:
6464
OS: ${{ runner.os }}
65+
66+
# We need to have the "conclusion" job also on PR CI, to make it possible
67+
# to add PRs to a merge queue.
68+
conclusion:
69+
needs: [ base ]
70+
# We need to ensure this job does *not* get skipped if its dependencies fail,
71+
# because a skipped job is considered a success by GitHub. So we have to
72+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
73+
# when the workflow is canceled manually.
74+
#
75+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
76+
if: ${{ !cancelled() }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
# Manually check the status of all dependencies. `if: failure()` does not work.
80+
- name: Conclusion
81+
run: |
82+
# Print the dependent jobs to see them in the CI log
83+
jq -C <<< '${{ toJson(needs) }}'
84+
# Check if all jobs that we depend on (in the needs array) were successful.
85+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

0 commit comments

Comments
 (0)