fix: fail fast on skill registration errors
This commit is contained in:
parent
46f61d6660
commit
9203a55ee0
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue