commit 993bbae41ae086fabf89b55f88a035b2d5b6c64a parent 2b86acd07ccb0a0cbe175bed032ed9650265484d Author: Damian Myrda <damian@prime8.dev> Date: Tue, 17 Feb 2026 10:29:43 -0600 Fix JSON escaping in webhook payload using jq Diffstat:
| M | .gitlab-ci.yml | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -5,9 +5,14 @@ deploy: stage: deploy script: - | + PAYLOAD=$(jq -n \ + --arg ref "refs/heads/master" \ + --arg commit "$CI_COMMIT_SHA" \ + --arg msg "$CI_COMMIT_MESSAGE" \ + '{ref: $ref, commit: $commit, commit_message: $msg}') curl -X POST "${DOKPLOY_DEPLOY_URL}" \ -H "Content-Type: application/json" \ -H "X-Gitlab-Event: Push Hook" \ - -d "{\"ref\": \"refs/heads/master\", \"commit\": \"${CI_COMMIT_SHA}\", \"commit_message\": \"${CI_COMMIT_MESSAGE}\"}" + -d "$PAYLOAD" only: - master