Skip to content

Commit 0c9abb9

Browse files
fix(ci): fix YAML indentation bug in playground-uptime-check.yml (DAK-7032) (#237)
The multi-line MSG string assignment had lines starting at column 0 inside a `run: |` block that requires 10-space indentation. YAML terminated the block prematurely, causing GitHub Actions to report "workflow file issue" on every run. Fix: replace multi-line string with printf format string (single properly-indented line), and use jq for proper JSON encoding of the Telegram payload. This avoids newlines inside the YAML block and correctly serialises multi-line message content as JSON. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 66a523d commit 0c9abb9

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

.github/workflows/playground-uptime-check.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,14 @@ jobs:
3737
DAKERA_STATUS="${{ steps.health.outputs.dakera_status }}"
3838
VERSION="${{ steps.health.outputs.version }}"
3939
RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
40-
41-
MSG="🔴 *[Platform] Playground DOWN*
42-
43-
URL: \`https://playground.dakera.ai/health\`
44-
HTTP: \`${HTTP_STATUS}\`
45-
Dakera status: \`${DAKERA_STATUS}\`
46-
Version: \`${VERSION}\`
47-
Run: ${RUN_URL}
48-
49-
Check playground server containers and proxy."
50-
40+
CHAT_ID="${{ secrets.TELEGRAM_CHAT_ID }}"
41+
MSG=$(printf "🔴 *[Platform] Playground DOWN*\n\nURL: \`https://playground.dakera.ai/health\`\nHTTP: \`%s\`\nDakera status: \`%s\`\nVersion: \`%s\`\nRun: %s\n\nCheck playground server containers and proxy." \
42+
"$HTTP_STATUS" "$DAKERA_STATUS" "$VERSION" "$RUN_URL")
43+
BODY=$(jq -n --arg chat_id "$CHAT_ID" --arg text "$MSG" \
44+
'{chat_id: $chat_id, text: $text, parse_mode: "Markdown"}')
5145
curl -sf -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
5246
-H "Content-Type: application/json" \
53-
-d "{\"chat_id\":\"${{ secrets.TELEGRAM_CHAT_ID }}\",\"text\":\"$(echo "$MSG" | sed 's/"/\\"/g')\",\"parse_mode\":\"Markdown\"}" \
47+
-d "$BODY" \
5448
> /dev/null || true
5549
echo "Telegram alert sent"
5650
exit 1

0 commit comments

Comments
 (0)