We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8135271 commit ad6fcd8Copy full SHA for ad6fcd8
1 file changed
.github/workflows/ValidatePullRequest.yml
@@ -98,9 +98,8 @@ jobs:
98
if: always()
99
runs-on: ubuntu-latest
100
steps:
101
- - name: Previous jobs succeeded
102
- if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
103
- run: exit 0
104
- - name: Previous jobs failed
105
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
106
- run: exit 1
+ # Calculate the exit status of the whole CI workflow.
+ # If all dependent jobs were successful, this exits with 0 (and the outcome job continues successfully).
+ # If a some dependent job has failed, this exits with 1.
+ - name: calculate the correct exit status
+ run: jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
0 commit comments