File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -17,28 +17,30 @@ jobs:
1717 runs-on : ubuntu-latest
1818 timeout-minutes : 10
1919 needs :
20- - ci-req-check
2120 - yaml-lint
2221 - shell-lint
2322 - action-lint
2423 - ansible-lint
2524 - terraform-validate
2625 - sops-secrets-check
2726 - kics-check
27+ if : ${{ always() }}
2828 steps :
29- - name : All status check
30- run : echo "All status check passed"
31-
32- ci-req-check :
33- runs-on : ubuntu-latest
34- timeout-minutes : 10
35- steps :
36- - uses : actions/checkout@v4
29+ - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3730 - name : Check all-status-check
3831 run : |
3932 diff \
4033 <(yq ".jobs | del(.all-status-check) | keys.[]" .github/workflows/ci.yml) \
4134 <(yq ".jobs.all-status-check.needs.[]" .github/workflows/ci.yml)
35+ - name : Fail if any needed job failed
36+ env :
37+ JOBS : ${{ toJson(needs) }}
38+ run : |
39+ for result in $(jq -r '.[].result' <<<"$JOBS"); do
40+ if [[ ! "$result" =~ ^(success|skipped)$ ]]; then
41+ exit 1
42+ fi
43+ done
4244
4345 yaml-lint :
4446 runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments