From b804c574c8f236289db8777f4bb4293d16b8a4e7 Mon Sep 17 00:00:00 2001 From: OG T Date: Wed, 1 Apr 2026 10:35:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(cd):=20=E4=BF=AE=E5=BE=A9=20YAML=20?= =?UTF-8?q?=E8=AA=9E=E6=B3=95=E9=8C=AF=E8=AA=A4=20-=20CD=20=E7=AE=A1?= =?UTF-8?q?=E9=81=93=E5=BE=9E=2077d0fe7=20=E5=BE=8C=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E8=A7=B8=E7=99=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根本原因: 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 --- .gitea/workflows/cd.yaml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index 9a3c549a..024b9e5e 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -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="🚀 AWOOOI 部署開始 -├ 📝 ${{ steps.commit.outputs.message }} -├ 🔖 ${{ steps.commit.outputs.short_sha }} -├ 👤 ${{ github.actor }} -└ 🌿 main" + -d "text=🚀 AWOOOI 部署開始%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 ${{ steps.commit.outputs.short_sha }}%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="✅ AWOOOI 部署完成 -├ 📝 ${{ steps.commit.outputs.message }} -├ 🔖 ${{ steps.commit.outputs.short_sha }} -├ ⏱️ 耗時: ${MINUTES}m ${SECONDS}s -├ 📦 API: ✅ Web: ✅ -└ 🩺 Health: ✅" + -d "text=✅ AWOOOI 部署完成%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 ${{ steps.commit.outputs.short_sha }}%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="❌ AWOOOI 部署失敗 -├ 📝 ${{ steps.commit.outputs.message }} -├ 🔖 ${{ steps.commit.outputs.short_sha }} -├ 👤 ${{ github.actor }} -└ 🔗 查看日誌" + -d "text=❌ AWOOOI 部署失敗%0A├ 📝 ${{ steps.commit.outputs.message }}%0A├ 🔖 ${{ steps.commit.outputs.short_sha }}%0A├ 👤 ${{ github.actor }}%0A└ 🔗 查看日誌"