From 300c13121f17c9715fc7fdad51c5feccd0d6acd9 Mon Sep 17 00:00:00 2001 From: Wei Lin Date: Mon, 7 Sep 2026 01:11:17 +0800 Subject: [PATCH] Fix AI security scan transport failures --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15e07f82..36b26096 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,10 +116,30 @@ jobs: temperature: 0.1 }') - RESPONSE=$(curl -s "$URL" \ + CURL_EXIT=0 + RESPONSE=$(curl --silent --show-error \ + --retry 4 \ + --retry-all-errors \ + --retry-delay 2 \ + --connect-timeout 15 \ + --max-time 120 \ + "$URL" \ -H "Content-Type: application/json" \ -H "api-key: $AZURE_OPENAI_API_KEY" \ - -d "$PAYLOAD") + -d "$PAYLOAD") || CURL_EXIT=$? + + if [ "$CURL_EXIT" -ne 0 ]; then + case "$CURL_EXIT" in + 5|6|7|28|35|52|56) + echo "::warning::AI Security Review unavailable after retries (curl exit $CURL_EXIT); skipping external review" + exit 0 + ;; + *) + echo "::error::AI Security Review request failed (curl exit $CURL_EXIT)" + exit "$CURL_EXIT" + ;; + esac + fi # Extract content CONTENT=$(echo "$RESPONSE" | jq -r '.choices[0].message.content // empty')