forked from docs/doc-exports
Update .gitea/workflows/openapi.yml
This commit is contained in:
@ -90,6 +90,8 @@ jobs:
|
||||
- name: Validate OpenAPI files + show validation results
|
||||
env:
|
||||
INTERNAL_OPENAPI_KEY: ${{ secrets.INTERNAL_OPENAPI_KEY }}
|
||||
OPENAPI_URL: ${{ variables.OPENAPI_URL }}
|
||||
REPORTPORTAL_URL: ${{ variables.REPORTPORTAL_URL }}
|
||||
run: |
|
||||
set -e
|
||||
|
||||
@ -97,7 +99,7 @@ jobs:
|
||||
SLEEP_SECONDS=10
|
||||
|
||||
# --- Fetching access token ---
|
||||
OPENAPI_TOKEN="$(curl -X POST "https://openapi-validator.eco-preprod.tsi-dev.otc-service.com/api/token/machine" \
|
||||
OPENAPI_TOKEN="$(curl -X POST "https://${OPENAPI_URL}/api/token/machine" \
|
||||
-H "X-Internal-Api-Key: $INTERNAL_OPENAPI_KEY" | jq -r .access_token)"
|
||||
echo "::add-mask::$OPENAPI_TOKEN"
|
||||
|
||||
@ -108,7 +110,7 @@ jobs:
|
||||
echo "Validating: $url"
|
||||
|
||||
# --- 1. trigger validation ---
|
||||
VALIDATION_RESPONSE=$(curl -sS -X POST "https://openapi-validator.eco-preprod.tsi-dev.otc-service.com/api/validate" \
|
||||
VALIDATION_RESPONSE=$(curl -sS -X POST "https://${OPENAPI_URL}/api/validate" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $OPENAPI_TOKEN" \
|
||||
-d "$(jq -n \
|
||||
@ -138,7 +140,7 @@ jobs:
|
||||
|
||||
LAUNCH_DETAILS=$(curl -sS \
|
||||
-H "Authorization: Bearer $OPENAPI_TOKEN" \
|
||||
"https://openapi-validator.eco-preprod.tsi-dev.otc-service.com/api/reportportal?project=openapi&launchId=$LAUNCH_UUID")
|
||||
"https://${OPENAPI_URL}/api/reportportal?project=openapi&launchId=$LAUNCH_UUID")
|
||||
|
||||
STATUS=$(echo "$LAUNCH_DETAILS" | jq -r '.status // "UNKNOWN"')
|
||||
echo "Current status: $STATUS"
|
||||
@ -166,7 +168,7 @@ jobs:
|
||||
LAUNCH_ID=$(echo "$LAUNCH_DETAILS" | jq -r '.id')
|
||||
|
||||
# fallback if API doesn't return UI link
|
||||
REPORT_URL="https://reportportal-dev.tsi-dev.otc-service.com/ui/#openapi/launches/all/$LAUNCH_ID"
|
||||
REPORT_URL="https://${REPORTPORTAL_URL}/ui/#openapi/launches/all/$LAUNCH_ID"
|
||||
|
||||
# --- 5. summary ---
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user