Update deploy.yml

This commit is contained in:
Vaica committed 2026-06-24 23:22:07 +08:00
1 parent 6283738db8
commit 8f2065315b
1 file changed
+10 -9
+10 -9
View File
@@ -497,20 +497,20 @@ jobs:
steps: steps:
- name: Send Telegram failure notification - name: Send Telegram failure notification
if: secrets.TELEGRAM_BOT_TOKEN && secrets.TELEGRAM_CHAT_ID if: ${{ secrets.TELEGRAM_BOT_TOKEN != '' && secrets.TELEGRAM_CHAT_ID != '' }}
env: env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: | run: |
MESSAGE="❌ **部署失败** MESSAGE="❌ **部署失败**
📦 项目: ${{ github.repository }} 📦 项目: ${{ github.repository }}
🌿 分支: ${{ github.ref_name }} 🌿 分支: ${{ github.ref_name }}
🔗 Commit: ${{ github.sha }} 🔗 Commit: ${{ github.sha }}
🕐 时间: $(date +'%Y-%m-%d %H:%M:%S') 🕐 时间: $(date +'%Y-%m-%d %H:%M:%S')
📝 工作流: ${{ github.workflow }} 📝 工作流: ${{ github.workflow }}
🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" 🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
-d chat_id="${TELEGRAM_CHAT_ID}" \ -d chat_id="${TELEGRAM_CHAT_ID}" \
@@ -518,15 +518,16 @@ jobs:
-d parse_mode="Markdown" -d parse_mode="Markdown"
- name: Send Feishu failure notification - name: Send Feishu failure notification
if: secrets.FEISHU_WEBHOOK_URL if: ${{ secrets.FEISHU_WEBHOOK_URL != '' }}
env: env:
FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }} FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }}
run: | run: |
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
curl -s -X POST "${FEISHU_WEBHOOK_URL}" \ curl -s -X POST "${FEISHU_WEBHOOK_URL}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{ -d '{
"msg_type": "text", "msg_type": "text",
"content": { "content": {
"text": "❌ **部署失败**\n\n📦 项目: ${{ github.repository }}\n🌿 分支: ${{ github.ref_name }}\n🔗 Commit: ${{ github.sha }}\n🕐 时间: '$(date +'%Y-%m-%d %H:%M:%S')'\n\n📝 工作流: ${{ github.workflow }}\n🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" "text": "❌ **部署失败**\n\n📦 项目: ${{ github.repository }}\n🌿 分支: ${{ github.ref_name }}\n🔗 Commit: ${{ github.sha }}\n🕐 时间: '"${CURRENT_TIME}"'\n\n📝 工作流: ${{ github.workflow }}\n🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
} }
}' }'