合并 internal → main: 退款/提现/激活/CI 全面优化 #4
@@ -200,26 +200,26 @@ jobs:
|
|||||||
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
|
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${TG_BOT_TOKEN:-}" ] || [ -z "${TG_CHAT_ID:-}" ]; then
|
if [ -z "${TG_BOT_TOKEN:-}" ] || [ -z "${TG_CHAT_ID:-}" ]; then
|
||||||
echo "Telegram secrets are not configured; skipping notification."
|
echo "Telegram 密钥未配置,跳过通知。"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MESSAGE="$(cat <<'EOF'
|
MESSAGE="$(cat <<'EOF'
|
||||||
✅ Staging deploy succeeded
|
✅ 测试环境发布成功
|
||||||
Repository: ${{ github.repository }}
|
仓库:${{ github.repository }}
|
||||||
Branch: ${{ github.ref_name }}
|
分支:${{ github.ref_name }}
|
||||||
Commit: ${{ github.sha }}
|
提交:${{ github.sha }}
|
||||||
Actor: ${{ github.actor }}
|
操作人:${{ github.actor }}
|
||||||
Image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
镜像:${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
Updates:
|
本次更新:
|
||||||
${{ steps.release-notes.outputs.notes }}
|
${{ steps.release-notes.outputs.notes }}
|
||||||
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
运行记录:${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
EOF
|
EOF
|
||||||
)"
|
)"
|
||||||
|
|
||||||
curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage" \
|
curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage" \
|
||||||
--data-urlencode "chat_id=${TG_CHAT_ID}" \
|
--data-urlencode "chat_id=${TG_CHAT_ID}" \
|
||||||
--data-urlencode "text=${MESSAGE}" || echo "Telegram notification failed; deployment result is unchanged."
|
--data-urlencode "text=${MESSAGE}" || echo "Telegram 通知发送失败,但发布结果不受影响。"
|
||||||
|
|
||||||
- name: Notify Telegram on failure
|
- name: Notify Telegram on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
@@ -228,23 +228,23 @@ jobs:
|
|||||||
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
|
TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }}
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${TG_BOT_TOKEN:-}" ] || [ -z "${TG_CHAT_ID:-}" ]; then
|
if [ -z "${TG_BOT_TOKEN:-}" ] || [ -z "${TG_CHAT_ID:-}" ]; then
|
||||||
echo "Telegram secrets are not configured; skipping notification."
|
echo "Telegram 密钥未配置,跳过通知。"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
MESSAGE="$(cat <<'EOF'
|
MESSAGE="$(cat <<'EOF'
|
||||||
❌ Staging deploy failed
|
❌ 测试环境发布失败
|
||||||
Repository: ${{ github.repository }}
|
仓库:${{ github.repository }}
|
||||||
Branch: ${{ github.ref_name }}
|
分支:${{ github.ref_name }}
|
||||||
Commit: ${{ github.sha }}
|
提交:${{ github.sha }}
|
||||||
Actor: ${{ github.actor }}
|
操作人:${{ github.actor }}
|
||||||
Image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
|
镜像:${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
Updates:
|
本次更新:
|
||||||
${{ steps.release-notes.outputs.notes }}
|
${{ steps.release-notes.outputs.notes }}
|
||||||
Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
运行记录:${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
EOF
|
EOF
|
||||||
)"
|
)"
|
||||||
|
|
||||||
curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage" \
|
curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_TOKEN}/sendMessage" \
|
||||||
--data-urlencode "chat_id=${TG_CHAT_ID}" \
|
--data-urlencode "chat_id=${TG_CHAT_ID}" \
|
||||||
--data-urlencode "text=${MESSAGE}" || echo "Telegram notification failed; workflow failure was already recorded."
|
--data-urlencode "text=${MESSAGE}" || echo "Telegram 通知发送失败,工作流失败状态已记录。"
|
||||||
|
|||||||
Reference in New Issue
Block a user