Skip to content

Commit f52fe5d

Browse files
authored
Match required-check names against the actual GitHub check-run names (#2)
release-prepare.yml's belt-and-braces validator iterated over the YAML job IDs (check, test, build, smoke, release-tooling) but GitHub reports check runs by their human-readable name: field (Type check, Unit tests, Production build, Smoke (real sync-server), Release tooling). Result: the validator always failed even when main was fully green. Caught on the first dry-run.
1 parent c1137e0 commit f52fe5d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/release-prepare.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,16 @@ jobs:
9191
fi
9292
# Belt-and-braces: assert the expected check names are present and successful so
9393
# a commit that somehow skipped CI entirely can't sneak through.
94-
for expected in check test build smoke release-tooling; do
94+
# NB: these are the `name:` fields from code-checks.yml (what GitHub reports
95+
# as the check-run name), not the YAML job IDs.
96+
expected_checks=(
97+
"Type check"
98+
"Unit tests"
99+
"Production build"
100+
"Smoke (real sync-server)"
101+
"Release tooling"
102+
)
103+
for expected in "${expected_checks[@]}"; do
95104
ok=$(echo "$checks" | jq --arg n "$expected" '[.[] | select(.name == $n and .conclusion == "success")] | length')
96105
if [[ "$ok" == "0" ]]; then
97106
echo "::error::Required check '$expected' is missing or not successful on this commit." >&2

0 commit comments

Comments
 (0)