additional checks

This commit is contained in:
2026-02-24 12:13:59 +01:00
parent 8e38ff8c9e
commit 3f4bdc86f8

View File

@ -110,13 +110,23 @@ jobs:
echo "=============================="
echo "Validating: $url"
# --- 1. trigger validation ---
# --- 1. fetch spec content from URL and ensure it is not empty ---
FILE_CONTENT=$(curl -fsSL "$url" || true)
# Treat whitespace-only as empty
if [ -z "$(echo "$FILE_CONTENT" | tr -d '[:space:]')" ]; then
echo "❌ Spec content is empty or could not be fetched: $url"
HAS_FAILURE=1
continue
fi
# --- 2. trigger validation using file_content ---
VALIDATION_RESPONSE=$(curl -sS -X POST "https://${API_URL}/api/validate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAPI_TOKEN" \
-d "$(jq -n \
--arg path "$url" \
'{path: $path, export: "xml", ruleset: "default"}')")
--arg file_content "$FILE_CONTENT" \
'{file_content: $file_content, export: "xml", ruleset: "default"}')")
echo "Validation response:"
echo "$VALIDATION_RESPONSE"
@ -130,7 +140,7 @@ jobs:
continue
fi
echo "Launch ID: $LAUNCH_ID"
echo "Launch UUID: $LAUNCH_UUID"
# --- 3. wait until validation finishes ---
ATTEMPT=1
@ -155,6 +165,7 @@ jobs:
if [ "$STATUS" = "IN_PROGRESS" ]; then
echo "⚠️ Timeout waiting for validation to finish"
HAS_FAILURE=1
continue
fi