From e7dc2f854d1f7847c9dc104bb3c9c04e0aec664e Mon Sep 17 00:00:00 2001 From: thompson Date: Sat, 18 Jul 2026 18:51:41 +0100 Subject: [PATCH] fix(ci): require readyz JSON body in healthcheck, not just HTTP 200 A live workflow_dispatch against prod returned HTTP 200 even though /healthz is not yet deployed: the shell's React Router SSR catch-all answers 200 (HTML) for the unmatched path, so a status-code-only check is a false-healthy. Require the readiness-backed body ({"status":"ok"}) in addition to 200 so a green run proves we actually reached /healthz and the backend is up. A stale/rolled-back deploy that loses the route now correctly goes red instead of silently passing. --- .github/workflows/healthcheck.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/healthcheck.yml b/.github/workflows/healthcheck.yml index 76f2f4d..4b7e30d 100644 --- a/.github/workflows/healthcheck.yml +++ b/.github/workflows/healthcheck.yml @@ -58,7 +58,12 @@ jobs: -w "%{http_code}" \ "$url") || true echo "Attempt ${i}/${attempts}: HTTP ${http_code}" - if [ "$http_code" = "200" ]; then + # A 200 status alone is not sufficient: the shell's React Router SSR + # catch-all also answers 200 (HTML) for an unmatched path, so a stale + # deploy without /healthz would look "healthy". Require the + # readiness-backed JSON body ({"status":"ok"}) so a green run proves + # we actually reached /healthz and the backend is up. + if [ "$http_code" = "200" ] && grep -q '"status":"ok"' /tmp/healthz_body; then echo "healthz OK" exit 0 fi