fix(ci): 修復 cd.yaml YAML 解析失敗 — ├ 字元缺縮排導致 CI 全停
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 23m35s
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 23m35s
根因: commit5ee76dc引入 HTML 結構化格式時,MSG 多行字串的 ├/└ 行縮排為 0,YAML block scalar 解析失敗 (yaml: line 72: could not find expected ':') 影響: 2026-04-16 03:27 後所有 commit 均無法觸發 CI build 包含:cd1c0ff(5-tuple 修復) +9ea1f77(ghost button) +8582439(KB fix) 修復: 兩處 MSG 改用 printf 單行格式,消除多行 YAML 縮排陷阱 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,10 +68,7 @@ jobs:
|
|||||||
ACTOR="${{ github.actor }}"
|
ACTOR="${{ github.actor }}"
|
||||||
# HTML escape commit message(防特殊字元破壞 HTML)
|
# HTML escape commit message(防特殊字元破壞 HTML)
|
||||||
COMMIT_ESC=$(echo "$COMMIT_MSG" | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
COMMIT_ESC=$(echo "$COMMIT_MSG" | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
||||||
MSG="🚀 <b>AWOOOI 部署開始</b>
|
MSG=$(printf '🚀 <b>AWOOOI 部署開始</b>\n├ 📝 <code>%s</code>\n├ 🔖 <code>%s</code>\n└ 👤 %s' "${COMMIT_ESC}" "${SHORT_SHA}" "${ACTOR}")
|
||||||
├ 📝 <code>${COMMIT_ESC}</code>
|
|
||||||
├ 🔖 <code>${SHORT_SHA}</code>
|
|
||||||
└ 👤 ${ACTOR}"
|
|
||||||
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$(jq -n --arg c "${{ secrets.TELEGRAM_CHAT_ID }}" --arg t "$MSG" '{chat_id:$c,text:$t,parse_mode:"HTML"}')"
|
-d "$(jq -n --arg c "${{ secrets.TELEGRAM_CHAT_ID }}" --arg t "$MSG" '{chat_id:$c,text:$t,parse_mode:"HTML"}')"
|
||||||
@@ -580,11 +577,7 @@ jobs:
|
|||||||
SHORT_SHA="${{ steps.commit.outputs.short_sha }}"
|
SHORT_SHA="${{ steps.commit.outputs.short_sha }}"
|
||||||
ACTOR="${{ github.actor }}"
|
ACTOR="${{ github.actor }}"
|
||||||
COMMIT_ESC=$(echo "$COMMIT_MSG" | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
COMMIT_ESC=$(echo "$COMMIT_MSG" | sed 's/&/\&/g; s/</\</g; s/>/\>/g')
|
||||||
MSG="❌ <b>AWOOOI 部署失敗</b>
|
MSG=$(printf '❌ <b>AWOOOI 部署失敗</b>\n├ 📝 <code>%s</code>\n├ 🔖 <code>%s</code>\n├ 👤 %s\n└ 🔗 http://192.168.0.110:3001/wooo/awoooi/actions' "${COMMIT_ESC}" "${SHORT_SHA}" "${ACTOR}")
|
||||||
├ 📝 <code>${COMMIT_ESC}</code>
|
|
||||||
├ 🔖 <code>${SHORT_SHA}</code>
|
|
||||||
├ 👤 ${ACTOR}
|
|
||||||
└ 🔗 http://192.168.0.110:3001/wooo/awoooi/actions"
|
|
||||||
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$(jq -n --arg c "${{ secrets.TELEGRAM_CHAT_ID }}" --arg t "$MSG" '{chat_id:$c,text:$t,parse_mode:"HTML"}')"
|
-d "$(jq -n --arg c "${{ secrets.TELEGRAM_CHAT_ID }}" --arg t "$MSG" '{chat_id:$c,text:$t,parse_mode:"HTML"}')"
|
||||||
|
|||||||
Reference in New Issue
Block a user