Skip to content

Commit a371627

Browse files
ci: add aggregate CI OK check so a skipped job cannot pass the gate
The ruleset requires the `build` check, but `build` has `needs: test`, so a failing `test` leaves `build` reporting "skipped" — and GitHub counts a skipped required check as satisfied. `test` is not itself required, so nothing blocked the merge: six Renovate PRs automerged onto a red `localstack` between Aug 22 and Aug 30. Add a `ci-ok` job depending on every other job that treats any result other than "success" as a failure. Requires a matching ruleset change to require `CI OK` in place of `build`; this commit alone does not close the hole.
1 parent 7ec133c commit a371627

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,28 @@ jobs:
7171
files: bin/*
7272
generate_release_notes: true
7373
prerelease: ${{ inputs.prerelease || endsWith(github.ref, '-pre') || endsWith(inputs.version, '-pre') }}
74+
75+
# Single aggregate check for the branch ruleset to require.
76+
#
77+
# `build` needs `test`, so a failing `test` leaves `build` reporting "skipped" —
78+
# which GitHub counts as a passing required status check. That is how six
79+
# Renovate PRs automerged onto a red `localstack` between Aug 22 and Aug 30.
80+
#
81+
# This job depends on every other job and treats anything other than "success"
82+
# as a failure, so a skip can no longer masquerade as a pass. `if: always()`
83+
# is required: without it the job would itself be skipped when an upstream job
84+
# fails, and a required check that never reports blocks the PR as pending.
85+
# Add new jobs to `needs` as they are introduced.
86+
ci-ok:
87+
name: CI OK
88+
if: always()
89+
needs: [test, build]
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Verify upstream jobs succeeded
93+
env:
94+
RESULTS: ${{ toJSON(needs) }}
95+
run: |
96+
echo "$RESULTS"
97+
echo "$RESULTS" | jq -e 'to_entries | map(select(.value.result != "success")) | length == 0' > /dev/null \
98+
|| { echo "::error::One or more upstream jobs did not succeed"; exit 1; }

0 commit comments

Comments
 (0)