content check

This commit is contained in:
2026-02-24 14:36:44 +01:00
parent 3f4bdc86f8
commit 409fe16e38

View File

@ -92,6 +92,7 @@ jobs:
INTERNAL_OPENAPI_KEY: ${{ secrets.INTERNAL_OPENAPI_KEY }}
API_URL: ${{ vars.OPENAPI_URL }}
REPORTPORTAL_URL: ${{ vars.REPORTPORTAL_URL }}
GITEA_TOKEN: ${{ secrets.G_TOKEN_TEST }}
run: |
set -e
@ -111,7 +112,7 @@ jobs:
echo "Validating: $url"
# --- 1. fetch spec content from URL and ensure it is not empty ---
FILE_CONTENT=$(curl -fsSL "$url" || true)
FILE_CONTENT=$(curl -fsSL "${url}?token=${G_TOKEN_TEST}" || true)
# Treat whitespace-only as empty
if [ -z "$(echo "$FILE_CONTENT" | tr -d '[:space:]')" ]; then
@ -120,6 +121,10 @@ jobs:
continue
fi
echo "--- First 5 lines of spec ---"
echo "$FILE_CONTENT" | head -n 5
echo "-----------------------------"
# --- 2. trigger validation using file_content ---
VALIDATION_RESPONSE=$(curl -sS -X POST "https://${API_URL}/api/validate" \
-H "Content-Type: application/json" \