fix: Handle HTTP redirects in workflow curl requests (#240)
* update workflow * fix workflow
This commit is contained in:
4
.github/workflows/deploy-cloudflare.yml
vendored
4
.github/workflows/deploy-cloudflare.yml
vendored
@@ -181,7 +181,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HTTP_CODE=$(curl -s -w "%{http_code}" -o response.txt "$WORKER_URL/api/init/${JWT_SECRET}")
|
HTTP_CODE=$(curl -sL -w "%{http_code}" -o response.txt "$WORKER_URL/api/init/${JWT_SECRET}")
|
||||||
RESPONSE_BODY=$(cat response.txt)
|
RESPONSE_BODY=$(cat response.txt)
|
||||||
|
|
||||||
if [ "$RESPONSE_BODY" = "success" ]; then
|
if [ "$RESPONSE_BODY" = "success" ]; then
|
||||||
@@ -198,7 +198,7 @@ jobs:
|
|||||||
|
|
||||||
WORKER_URL="${CUSTOM_DOMAIN:-${{ steps.deploy.outputs.worker_url }}}"
|
WORKER_URL="${CUSTOM_DOMAIN:-${{ steps.deploy.outputs.worker_url }}}"
|
||||||
|
|
||||||
HTTP_CODE=$(curl -s -w "%{http_code}" -o response.txt \
|
HTTP_CODE=$(curl -sL --post301 --post302 --post303 -w "%{http_code}" -o response.txt \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"domainList\": $DOMAIN,\"accountId\":\"$CLOUDFLARE_ACCOUNT_ID\",\"token\":\"$CLOUDFLARE_API_TOKEN\",\"workerName\":\"$NAME\"}" \
|
-d "{\"domainList\": $DOMAIN,\"accountId\":\"$CLOUDFLARE_ACCOUNT_ID\",\"token\":\"$CLOUDFLARE_API_TOKEN\",\"workerName\":\"$NAME\"}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user