fix(cd): 修復 YAML 語法錯誤 - CD 管道從 77d0fe7 後完全停止觸發
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 13s
E2E Health Check / e2e-health (push) Successful in 16s

根本原因: Notify 步驟中的 text= 參數包含真實換行符,
Gitea YAML 解析器在 line 51 報錯「could not find expected ':'」,
導致 cd.yaml 無法被解析,整個 CD 管道失效超過 10+ 次 push。

修復: 換行符改用 URL encode %0A,符合 Telegram Bot API 格式。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-01 10:35:16 +08:00
parent 45e194cefb
commit b804c574c8

View File

@@ -47,11 +47,7 @@ jobs:
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d parse_mode="HTML" \
-d text="🚀 <b>AWOOOI 部署開始</b>
├ 📝 ${{ steps.commit.outputs.message }}
├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>
├ 👤 ${{ github.actor }}
└ 🌿 main"
-d "text=🚀 <b>AWOOOI 部署開始</b>%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>%0A├ 👤 ${{ github.actor }}%0A└ 🌿 main"
@@ -216,12 +212,7 @@ jobs:
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d parse_mode="HTML" \
-d text="✅ <b>AWOOOI 部署完成</b>
├ 📝 ${{ steps.commit.outputs.message }}
├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>
├ ⏱️ 耗時: ${MINUTES}m ${SECONDS}s
├ 📦 API: ✅ Web:
└ 🩺 Health: ✅"
-d "text=✅ <b>AWOOOI 部署完成</b>%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>%0A├ ⏱️ 耗時: ${MINUTES}m ${SECONDS}s%0A├ 📦 API: ✅ Web: ✅%0A└ 🩺 Health: ✅"
- name: Notify Pipeline Failure
if: failure()
@@ -229,8 +220,4 @@ jobs:
curl -fS -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \
-d parse_mode="HTML" \
-d text="❌ <b>AWOOOI 部署失敗</b>
├ 📝 ${{ steps.commit.outputs.message }}
├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>
├ 👤 ${{ github.actor }}
└ 🔗 <a href=\"http://192.168.0.110:3001/wooo/awoooi/actions\">查看日誌</a>"
-d "text=❌ <b>AWOOOI 部署失敗</b>%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 <code>${{ steps.commit.outputs.short_sha }}</code>%0A├ 👤 ${{ github.actor }}%0A└ 🔗 <a href=\"http://192.168.0.110:3001/wooo/awoooi/actions\">查看日誌</a>"