Add job timeout and use jq for safe JSON construction

- Add timeout-minutes: 30 to prevent runaway jobs
- Build /run-test payload with jq --arg to safely escape
  TUNNEL_URL and LITELLM_MASTER_KEY values

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro
2026-03-01 15:30:09 -03:00
co-authored by Claude Opus 4.6
parent 7a46aaff2b
commit a2946e2cc8
+11 -6
View File
@@ -30,6 +30,7 @@ env:
jobs:
observatory-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -99,15 +100,19 @@ jobs:
id: trigger
run: |
OBSERVATORY_URL="${{ secrets.OBSERVATORY_URL }}"
PAYLOAD=$(jq -n \
--arg url "${{ env.TUNNEL_URL }}" \
--arg key "${{ env.LITELLM_MASTER_KEY }}" \
'{
deployment_url: $url,
api_key: $key,
test_suite: "TestOAIAzureRelease",
models: ["gpt-4o-mini", "gpt-4o"]
}')
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${OBSERVATORY_URL}/run-test" \
-H "Content-Type: application/json" \
-H "X-LiteLLM-Observatory-API-Key: ${{ secrets.OBSERVATORY_API_KEY }}" \
-d '{
"deployment_url": "${{ env.TUNNEL_URL }}",
"api_key": "${{ env.LITELLM_MASTER_KEY }}",
"test_suite": "TestOAIAzureRelease",
"models": ["gpt-4o-mini", "gpt-4o"]
}')
-d "$PAYLOAD")
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -n -1)
echo "Response ($HTTP_CODE): $BODY"