diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81887dc9..d6324128 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -429,23 +429,23 @@ jobs: run: node scripts/generate_notification_report.js - name: Send Telegram notification - if: secrets.TELEGRAM_BOT_TOKEN && secrets.TELEGRAM_CHAT_ID + if: ${{ secrets.TELEGRAM_BOT_TOKEN != '' && secrets.TELEGRAM_CHAT_ID != '' }} env: TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} run: | MESSAGE="✅ **部署成功** -📦 项目: ${{ github.repository }} -🌿 分支: ${{ github.ref_name }} -🔗 Commit: ${{ github.sha }} -🕐 时间: $(date +'%Y-%m-%d %H:%M:%S') + 📦 项目: ${{ github.repository }} + 🌿 分支: ${{ github.ref_name }} + 🔗 Commit: ${{ github.sha }} + 🕐 时间: $(date +'%Y-%m-%d %H:%M:%S') + + 📊 部署目标: + - EdgeOne Pages ✓ + - UpYun ✓ + - CDN 刷新 ✓" -📊 部署目标: -- EdgeOne Pages ✓ -- UpYun ✓ -- CDN 刷新 ✓" - curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -d chat_id="${TELEGRAM_CHAT_ID}" \ -d text="${MESSAGE}" \