Skip to content

Commit b016a48

Browse files
joaquingxclaude
andcommitted
feat: add auto-deployment trigger for dev branch (#261)
* feat: add auto-deployment trigger for dev branch - Added trigger-dev-deployment.yml workflow - Triggers bitmaker-cloud-deploy when pushing to dev branch - Sends repository dispatch with commit info and metadata - Enables automatic deployment to development environment Co-Authored-By: Claude <[email protected]> * fix: escape JSON properly in deployment trigger workflow - Fixed JSON parsing error by properly escaping quotes - Added Content-Type header for clarity - Escaped commit messages to handle special characters Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 1a959cd commit b016a48

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/trigger-dev-deployment.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,24 @@ jobs:
1818
echo "Branch: ${{ github.ref_name }}"
1919
echo "Triggered by: ${{ github.actor }}"
2020
21+
# Escape commit message for JSON
22+
COMMIT_MSG=$(echo "${{ github.event.head_commit.message }}" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
23+
2124
response=$(curl -X POST \
2225
-H "Authorization: token ${{ secrets.DEPLOY_TRIGGER_TOKEN }}" \
2326
-H "Accept: application/vnd.github.v3+json" \
27+
-H "Content-Type: application/json" \
2428
"${{ secrets.DEPLOY_WEBHOOK_URL }}" \
25-
-d '{
26-
"event_type": "deploy-dev-auto",
27-
"client_payload": {
28-
"source_repo": "estela",
29-
"branch": "${{ github.ref_name }}",
30-
"commit": "${{ github.sha }}",
31-
"triggered_by": "${{ github.actor }}",
32-
"commit_message": "${{ github.event.head_commit.message }}"
29+
-d "{
30+
\"event_type\": \"deploy-dev-auto\",
31+
\"client_payload\": {
32+
\"source_repo\": \"estela\",
33+
\"branch\": \"${{ github.ref_name }}\",
34+
\"commit\": \"${{ github.sha }}\",
35+
\"triggered_by\": \"${{ github.actor }}\",
36+
\"commit_message\": \"${COMMIT_MSG}\"
3337
}
34-
}' \
38+
}" \
3539
-w "\n%{http_code}" \
3640
-s)
3741

0 commit comments

Comments
 (0)