Update deploy.yml
This commit is contained in:
1 parent
6283738db8
commit
8f2065315b
1 file changed
+11
-10
@@ -497,36 +497,37 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Send Telegram failure 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')
|
||||
|
||||
📝 工作流: ${{ github.workflow }}
|
||||
🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
|
||||
📝 工作流: ${{ github.workflow }}
|
||||
🔍 查看详情: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
|
||||
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
|
||||
-d chat_id="${TELEGRAM_CHAT_ID}" \
|
||||
-d text="${MESSAGE}" \
|
||||
-d parse_mode="Markdown"
|
||||
|
||||
- name: Send Feishu failure notification
|
||||
if: secrets.FEISHU_WEBHOOK_URL
|
||||
if: ${{ secrets.FEISHU_WEBHOOK_URL != '' }}
|
||||
env:
|
||||
FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }}
|
||||
run: |
|
||||
CURRENT_TIME=$(date +'%Y-%m-%d %H:%M:%S')
|
||||
curl -s -X POST "${FEISHU_WEBHOOK_URL}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"msg_type": "text",
|
||||
"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 }}"
|
||||
}
|
||||
}'
|
||||
Reference in new issue
Block a user