diff --git a/.gitea/workflows/push.yml b/.gitea/workflows/push.yml index 42b359b..eb034ff 100644 --- a/.gitea/workflows/push.yml +++ b/.gitea/workflows/push.yml @@ -99,41 +99,4 @@ jobs: curl -s -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ - -d @wechat_payload.json - - notify: - name: WeChat Notification - runs-on: ubuntu-latest - needs: [build, deploy, cleanup] - if: always() - steps: - - name: Send WeChat Notification - run: | - # 判断整体结果 - if [[ "${{ needs.build.result }}" == "success" && "${{ needs.deploy.result }}" == "success" ]]; then - MSG_TITLE="构建并部署成功" - RESULT_ICON="✅" - MSG_COLOR="info" - else - MSG_TITLE="自动部署发现异常" - RESULT_ICON="❌" - MSG_COLOR="warning" - fi - - WEBHOOK_URL="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=96f9fa23-a959-4492-ac3a-7415fae19680" - - # 准备 Markdown 内容 - # 使用 heredoc 简化 JSON 生成 - cat < wechat_payload.json - { - "msgtype": "markdown", - "markdown": { - "content": "### $RESULT_ICON $MSG_TITLE\n> **项目名称**: [${{ gitea.repository }}](${{ gitea.server_url }}/${{ gitea.repository }})\n> **流水线**: ${{ gitea.workflow }}\n> **运行编号**: [#${{ gitea.run_number }}](${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }})\n> **状态**: $MSG_TITLE\n> **分支**: \`${{ gitea.ref_name }}\`\n> **触发者**: ${{ gitea.actor }}\n> **提交详情**: [${{ gitea.sha }}](${{ gitea.server_url }}/${{ gitea.repository }}/commit/${{ gitea.sha }})" - } - } - EOF - - # 发送请求 - curl -s -X POST "\$WEBHOOK_URL" \\ - -H "Content-Type: application/json" \\ -d @wechat_payload.json \ No newline at end of file