Skip to content

Commit 8c8ecc1

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 b744d4d commit 8c8ecc1

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
@@ -50,6 +50,7 @@ jobs:
5050
all-passed:
5151
name: Check Build Status
5252
runs-on: ubuntu-latest
53+
if: always()
5354
needs:
5455
- lint-commits
5556
- code-style
@@ -62,5 +63,9 @@ jobs:
6263
with:
6364
egress-policy: audit
6465

65-
- name: Report Success
66-
run: echo "All required checks passed successfully."
66+
- name: Verify all jobs passed
67+
run: |
68+
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
69+
echo "One or more jobs failed or were cancelled."
70+
exit 1
71+
fi

0 commit comments

Comments
 (0)