diff --git a/.github/workflows/daily-e2e-health.yaml b/.github/workflows/daily-e2e-health.yaml index 4088ee1d..e5b814a6 100644 --- a/.github/workflows/daily-e2e-health.yaml +++ b/.github/workflows/daily-e2e-health.yaml @@ -93,6 +93,7 @@ jobs: kubectl get endpoints -n awoooi-prod awoooi-api || echo "⚠️ kubectl 失敗" - name: Check API Health + id: health run: | API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}" echo "🔗 檢查 API 健康狀態..." @@ -111,6 +112,7 @@ jobs: if [ "$HTTP_CODE" = "200" ]; then echo "✅ API 可用: $API_URL (HTTP $HTTP_CODE)" cat /tmp/health_response.txt + echo "working_api_url=$API_URL" >> $GITHUB_OUTPUT else echo "❌ API 無法連線: $API_URL (HTTP $HTTP_CODE)" echo "📋 Response:" @@ -125,6 +127,7 @@ jobs: if [ "$FALLBACK_CODE" = "200" ]; then echo "✅ 備用端點可用,VIP 可能有問題" cat /tmp/fallback_response.txt + echo "working_api_url=$FALLBACK_URL" >> $GITHUB_OUTPUT exit 0 # 備用成功,不算失敗 fi @@ -137,11 +140,12 @@ jobs: env: PYTHONPATH: ${{ github.workspace }}/apps/api run: | - API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}" + # 使用 Health Check 驗證過的可用 URL + API_URL="${{ steps.health.outputs.working_api_url }}" DRY_RUN="${{ github.event.inputs.dry_run || 'true' }}" echo "🎯 執行 E2E Tool Call Verification v2.0" - echo " API: $API_URL" + echo " API: $API_URL (verified working)" echo " Dry Run: $DRY_RUN" if [ "$DRY_RUN" = "true" ]; then