From 2bb76433f1359711faa5683e356cb795c50999b0 Mon Sep 17 00:00:00 2001 From: OG T Date: Tue, 24 Mar 2026 23:36:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(cd):=20=E6=94=B9=E5=96=84=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E9=80=9A=E7=9F=A5=E6=A0=BC=E5=BC=8F=20(=E7=94=A8?= =?UTF-8?q?=E6=88=B6=E5=8F=8B=E5=96=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 顯示版本描述 (commit message 前50字) - 顯示部署時間 (Asia/Taipei 時區) - 顯示作者 - 顯示簡短 SHA Co-Authored-By: Claude Opus 4.5 --- .github/workflows/cd.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 90c4b5b3..b564d166 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -257,12 +257,18 @@ jobs: - name: Notify Telegram if: always() run: | + # 取得 commit 資訊 + COMMIT_MSG=$(git log -1 --pretty=format:'%s' | head -c 50) + AUTHOR=$(git log -1 --pretty=format:'%an') + DEPLOY_TIME=$(TZ='Asia/Taipei' date '+%Y-%m-%d %H:%M') + SHORT_SHA=$(echo "${{ github.sha }}" | head -c 7) + if [ "${{ job.status }}" = "success" ]; then - MSG="✅ *AWOOOI 部署成功*" + MSG="✅ *AWOOOI 部署成功*%0A%0A📦 版本: ${COMMIT_MSG}%0A⏰ 時間: ${DEPLOY_TIME}%0A👤 作者: ${AUTHOR}%0A🔖 SHA: ${SHORT_SHA}%0A%0A🔗 [查看 Workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" else - MSG="❌ *AWOOOI 部署失敗*" + MSG="❌ *AWOOOI 部署失敗*%0A%0A📦 版本: ${COMMIT_MSG}%0A⏰ 時間: ${DEPLOY_TIME}%0A👤 作者: ${AUTHOR}%0A🔖 SHA: ${SHORT_SHA}%0A%0A🔗 [查看 Workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" fi curl -sf -X POST "https://api.telegram.org/bot${{ secrets.OPENCLAW_TG_BOT_TOKEN }}/sendMessage" \ -d chat_id="${{ secrets.OPENCLAW_TG_CHAT_ID }}" \ - -d text="${MSG}%0ACommit: \`${{ github.sha }}\`%0A🔗 [Workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" \ + -d text="${MSG}" \ -d parse_mode="Markdown" || true