Skip to content

Commit 8135c1a

Browse files
committed
ci: use Python to avoid shell+json quoting issues
1 parent bb9c347 commit 8135c1a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/reusable-build-docs.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ jobs:
111111
run: echo "TX_ID=$(date +%s)" >> "${GITHUB_ENV}"
112112

113113
- name: Notify the DaWGs in Matrix
114-
# FAIL_MESSAGE is trusted input so okay to inject here.
115-
# zizmor: ignore[template-injection]
116114
run: |
115+
body="$(python3 -c '
116+
import json
117+
import os
118+
import sys
119+
120+
json.dump({
121+
"msgtype": "m.text",
122+
"body": os.environ["FAIL_MESSAGE"],
123+
}, sys.stdout)'
124+
)"
117125
curl -X PUT "${ROOM_URL}/${TX_ID}" \
118126
-H "Authorization: Bearer ${{ secrets.DOCS_BOT_TOKEN }}" \
119127
-H "Content-Type: application/json" \
120-
-d '{"msgtype": "m.text", "body": "${{ env.FAIL_MESSAGE }}"}'
128+
-d "${body}"

0 commit comments

Comments
 (0)