Skip to content

Commit 2359c74

Browse files
committed
add conclusion job
1 parent fd98bbf commit 2359c74

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,28 @@ jobs:
173173
- name: Clippy check
174174
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
175175
working-directory: mock
176+
177+
conclusion:
178+
name: Conclusion
179+
needs:
180+
- test
181+
- lint
182+
- format
183+
- zizmor
184+
- package
185+
- action-test
186+
- rustfmt
187+
- clippy
188+
# !cancelled() executes the job regardless of whether the previous jobs passed, failed or get skipped.
189+
if: ${{ !cancelled() }}
190+
runs-on: ubuntu-24.04
191+
steps:
192+
- name: Conclusion
193+
env:
194+
# Store the JSON in an environment variable to avoid template injection.
195+
NEEDS_JSON: ${{ toJson(needs) }}
196+
run: |
197+
# Print the dependent jobs to see them in the CI log
198+
printf '%s\n' "$NEEDS_JSON" | jq -C
199+
# Check if all jobs that we depend on (in the needs array) were successful.
200+
printf '%s\n' "$NEEDS_JSON" | jq --exit-status 'all(.result == "success")'

0 commit comments

Comments
 (0)