fix: use python3 to parse OAuth2 token response (handles spaces in JSON)
Some checks failed
CI — Test & Build / Test & Build (push) Successful in 1m0s
Deploy — Chrome Web Store / Build & Deploy to Chrome Web Store (push) Failing after 1m0s
Release — Package & Publish / Build & Package Release (push) Successful in 57s

This commit is contained in:
2026-03-11 08:17:42 +00:00
parent 229fac8a2c
commit ecbab9c7ac

View File

@@ -51,10 +51,9 @@ jobs:
-d "client_secret=${{ secrets.CWS_CLIENT_SECRET }}" \
-d "refresh_token=${{ secrets.CWS_REFRESH_TOKEN }}" \
-d "grant_type=refresh_token")
echo "TOKEN_RESPONSE: $(echo $TOKEN_RESPONSE | sed 's/"access_token":"[^"]*"/"access_token":"***"/g')"
ACCESS_TOKEN=$(echo $TOKEN_RESPONSE | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['access_token'])" 2>/dev/null)
if [ -z "$ACCESS_TOKEN" ]; then
echo "❌ Failed to get access token"
echo "❌ Failed to get access token. Response: $TOKEN_RESPONSE"
exit 1
fi
echo "CWS_ACCESS_TOKEN=${ACCESS_TOKEN}" >> $GITHUB_ENV