添加部署 webhook 调用,优化 HTTP 请求处理
Agent CI/CD / validate (push) Successful in 23s
Agent CI/CD / docker-image (push) Successful in 8s
Agent CI/CD / deploy-fallback-log (push) Has been skipped

This commit is contained in:
2026-05-19 15:26:02 +08:00
parent 65a1a11b39
commit 2e6f4b0a10
+9 -2
View File
@@ -248,10 +248,17 @@ jobs:
post_deploy_webhook() {
label="$1"
payload="$2"
webhook_url="${{ vars.DEPLOY_WEBHOOK_URL }}"
token="${{ secrets.DEPLOY_WEBHOOK_TOKEN }}"
http_code=$(curl -sS -D /tmp/deploy_headers.txt -o /tmp/deploy_response.txt -w "%{http_code}" -X POST "${{ vars.DEPLOY_WEBHOOK_URL }}" \
# Trim whitespace
webhook_url=$(echo "$webhook_url" | xargs)
echo "[$label] Calling webhook: $webhook_url"
http_code=$(curl -sS -D /tmp/deploy_headers.txt -o /tmp/deploy_response.txt -w "%{http_code}" -X POST "$webhook_url" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.DEPLOY_WEBHOOK_TOKEN }}" \
-H "Authorization: Bearer $token" \
-d "$payload")
echo "[$label] webhook HTTP status: ${http_code}"