Skip to content

Commit e5af3ef

Browse files
committed
chore: fix all-passed gate to run with if: always()
The all-passed job depends on lint-commits which is always skipped on push events (due to its if: github.event_name == 'pull_request' conditional). GitHub Actions propagates skipped status to dependent jobs, so all-passed was silently skipped on every run and never actually gated anything. Adding if: always() ensures the gate job runs regardless of skipped dependencies, and the step now verifies that no jobs failed or were cancelled instead of unconditionally reporting success.
1 parent 64af1dd commit e5af3ef

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎.github/workflows/pipeline.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
all-passed:
6969
name: Check Build Status
7070
runs-on: ubuntu-latest
71+
if: always()
7172
needs:
7273
- lint-commits
7374
- code-style
@@ -76,12 +77,15 @@ jobs:
7677
- run-tests
7778
- code-inspection
7879
- build-docker
79-
if: ${{ success() }}
8080
steps:
8181
- name: Harden Runner
8282
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
8383
with:
8484
egress-policy: audit
8585

86-
- name: Report Success
87-
run: echo "All required checks passed successfully."
86+
- name: Verify all jobs passed
87+
run: |
88+
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
89+
echo "One or more jobs failed or were cancelled."
90+
exit 1
91+
fi

0 commit comments

Comments
 (0)