Skip to content

Commit 40dcf66

Browse files
authored
ci(github): remove redundant ci-req-check job and streamline CI workflow steps (#216)
1 parent 238fe97 commit 40dcf66

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)