From 7393cdf0a396a9373ca3510feb30f9171c1d0e09 Mon Sep 17 00:00:00 2001 From: mignot Date: Tue, 15 Sep 2026 17:58:16 +0200 Subject: [PATCH] fix(trigger-coolify-deploy): guard status-poll curl against transient exit 22 The deployment status polling loop's curl -sf | jq call was unguarded under set -euo pipefail, same class of bug as the mine_status check fixed in v4.3.2. A single non-2xx response (observed on the very first poll iteration in PR #253's preview deploy) hard-failed the whole action instead of retrying. Co-Authored-By: Claude Sonnet 5 --- .github/actions/trigger-coolify-deploy/action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/actions/trigger-coolify-deploy/action.yml b/.github/actions/trigger-coolify-deploy/action.yml index 1f554d2..39ad8f8 100644 --- a/.github/actions/trigger-coolify-deploy/action.yml +++ b/.github/actions/trigger-coolify-deploy/action.yml @@ -342,8 +342,21 @@ runs: start=$(date +%s) status="" while :; do + set +e status=$(curl -sf -H "Authorization: Bearer ${COOLIFY_API_TOKEN}" \ "${COOLIFY_API_URL}/api/v1/deployments/${deployment_uuid}" | jq -r '.status // empty') + status_query_status=$? + set -e + if [ "$status_query_status" -ne 0 ]; then + echo " WARNING: failed to query deployment ${deployment_uuid} status (exit ${status_query_status}) — retrying." >&2 + elapsed=$(( $(date +%s) - start )) + if [ "$elapsed" -ge "$POLL_TIMEOUT_SECONDS" ]; then + echo "ERROR: Timed out after ${POLL_TIMEOUT_SECONDS}s waiting for deployment (last status query failed)" + exit 1 + fi + sleep "$POLL_INTERVAL_SECONDS" + continue + fi case "$status" in finished) echo "Deployment finished."