diff --git a/.github/workflows/deploy_check.yml b/.github/workflows/deploy_check.yml index b1b16e7..670a8d7 100755 --- a/.github/workflows/deploy_check.yml +++ b/.github/workflows/deploy_check.yml @@ -29,19 +29,20 @@ jobs: status_code=$(echo $response | head -n 1) if [ $status_code -eq 200 ]; then body=$(curl -s https://chatwoot-pr-${{ github.event.pull_request.number }}.herokuapp.com/api) - if echo "$body" | jq -e '.version and .timestamp and .queue_services == "ok" and .data_services == "ok"' > /dev/null; then + # Check for required fields using grep to avoid jq dependency on self-hosted runners + if echo "$body" | grep -q '"version"' && echo "$body" | grep -q '"timestamp"' && echo "$body" | grep -q '"queue_services":"ok"' && echo "$body" | grep -q '"data_services":"ok"'; then echo "Deployment successful" exit 0 else - echo "Deployment status healthy but services not ready, retrying in 30 seconds..." + echo "Deployment status healthy but services not ready, retrying in 30 seconds... (Attempt $attempt/$max_attempts)" sleep 30 + attempt=$((attempt + 1)) fi else echo "Waiting for review app to be ready, retrying in 30 seconds... (Attempt $attempt/$max_attempts)" sleep 30 - attempt=$((attempt + 1)) + attempt=$((attempt + 1)) fi done echo "Deployment check timed out after $max_attempts attempts" - exit 1 - fi + exit 1