Feat/enteprise cd (#25508)

This commit is contained in:
Xiyuan Chen 2025-09-10 20:53:42 -07:00 committed by GitHub
parent 34e55028ae
commit af7f67dc9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 13 deletions

View File

@ -24,18 +24,18 @@ jobs:
DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }} DEV_ENV_ADDRS: ${{ vars.DEV_ENV_ADDRS }}
DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }} DEPLOY_SECRET: ${{ secrets.DEPLOY_SECRET }}
run: | run: |
IFS=',' read -ra ENDPOINTS <<< "$DEV_ENV_ADDRS" IFS=',' read -ra ENDPOINTS <<< "${DEV_ENV_ADDRS:-}"
BODY='{"project":"dify-api","tag":"deploy-enterprise"}'
for ENDPOINT in "${ENDPOINTS[@]}"; do for ENDPOINT in "${ENDPOINTS[@]}"; do
ENDPOINT=$(echo "$ENDPOINT" | xargs) ENDPOINT="$(echo "$ENDPOINT" | xargs)"
[ -z "$ENDPOINT" ] && continue
BODY=$(cat <<EOF
{ API_SIGNATURE=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}')
"project": "dify-api",
"tag": "deploy-enterprise" curl -sSf -X POST \
} -H "Content-Type: application/json" \
EOF -H "X-Hub-Signature-256: $API_SIGNATURE" \
) -d "$BODY" \
API_SIGNATURE=$(echo -n "$BODY" | openssl dgst -sha256 -hmac "$DEPLOY_SECRET" | awk '{print "sha256="$2}') "$ENDPOINT"
curl -X POST -H "Content-Type: application/json" -H "X-Hub-Signature-256: $API_SIGNATURE" -d "$BODY" "$ENDPOINT"
done done