Skip to content

Commit b10a7bc

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 aa5980d commit b10a7bc

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
all-passed:
7676
name: Check Build Status
7777
runs-on: ubuntu-latest
78+
if: always()
7879
needs:
7980
- lint-commits
8081
- code-style
@@ -90,5 +91,9 @@ jobs:
9091
with:
9192
egress-policy: audit
9293

93-
- name: Report Success
94-
run: echo "All required checks passed successfully."
94+
- name: Verify all jobs passed
95+
run: |
96+
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
97+
echo "One or more jobs failed or were cancelled."
98+
exit 1
99+
fi

0 commit comments

Comments
 (0)