fix: fail fast on skill registration errors
/ smoke (push) Successful in 4s Details
register-skill-release / register-skill-version (push) Successful in 2m0s Details

This commit is contained in:
ivanberry 2026-03-12 10:08:23 +08:00
parent 46f61d6660
commit 9203a55ee0
1 changed files with 11 additions and 3 deletions

View File

@ -91,7 +91,7 @@ jobs:
SKILL_SLUG="${GITHUB_REPOSITORY##*/}" SKILL_SLUG="${GITHUB_REPOSITORY##*/}"
fi fi
SESSION_RES=$(curl -sS -X POST "${API_BASE}/auth/skill-credit/session" \ SESSION_RES=$(curl -fsS -X POST "${API_BASE}/auth/skill-credit/session" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"clientKey\":\"${CLIENT_KEY}\"}") -d "{\"clientKey\":\"${CLIENT_KEY}\"}")
ACCESS_TOKEN=$(printf '%s' "$SESSION_RES" | jq -r '.accessToken // empty') ACCESS_TOKEN=$(printf '%s' "$SESSION_RES" | jq -r '.accessToken // empty')
@ -119,7 +119,15 @@ jobs:
} }
JSON JSON
curl -sS -X POST "${API_BASE}/ecom/skills/register-by-slug" \ HTTP_CODE=$(curl -sS -o /tmp/register_response.json -w '%{http_code}' -X POST "${API_BASE}/ecom/skills/register-by-slug" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \ -H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d @/tmp/register_payload.json -d @/tmp/register_payload.json)
if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then
echo "skill registration failed, http=${HTTP_CODE}"
cat /tmp/register_response.json
exit 1
fi
cat /tmp/register_response.json