You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: stop Build Gate from passing when no build actually ran
Two issues introduced in #8822 caused PRs to show a green Build Gate
without producing any build artifact:
1. concurrency.cancel-in-progress evaluated true for almost every
pull_request event, so an incidental event (e.g. a transient
draft toggle) cancelled the real in-flight Windows/macOS builds.
2. The Build Gate auto-passed whenever prebuild was skipped/cancelled
(only required prebuild.result != success), which is exactly what
happens after the cancellation above — leaving a green gate on a
commit that was never built.
Invert the cancel-in-progress logic to only cancel for events that
will actually produce a new build, and make the gate fail closed for
any prebuild outcome other than a successful "no Explorer/ changes"
decision.
# No Explorer/ changes, draft without override, or perf_test path — gate is not applicable.
892
-
if [ "$prebuild_result" != "success" ] || [ "$should_build" != "true" ]; then
893
-
echo "Gate not applicable (prebuild=$prebuild_result, should_build='$should_build'). Passing."
910
+
# Legit no-op: prebuild ran and decided no build is needed (no Explorer/ changes).
911
+
# The Prebuild job's "Skip build and test checks" step already posts per-target success
912
+
# statuses for this case, so the gate can safely pass.
913
+
if [ "$prebuild_result" = "success" ] && [ "$should_build" != "true" ]; then
914
+
echo "Gate not applicable (prebuild ran, no Explorer/ changes). Passing."
894
915
exit 0
895
916
fi
896
917
918
+
# Any other prebuild outcome (skipped/cancelled/failure) means no real build happened.
919
+
# Fail closed so an incidental PR event can't silently produce a green Build Gate.
920
+
if [ "$prebuild_result" != "success" ]; then
921
+
echo "::error::Prebuild did not succeed (result: $prebuild_result). No build produced for this commit; re-trigger the workflow (e.g. push a new commit or add the 'force-build' label)."
0 commit comments