Skip to content

Commit 4afe592

Browse files
committed
feat: send notification to feishu on ci failure
EE-18909
1 parent 9e327de commit 4afe592

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

.github/workflows/auto_merge_pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,19 @@ jobs:
3030
gh pr merge ${{ github.event.pull_request.number }} --auto --merge
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }}
33+
34+
notify-feishu-on-failure:
35+
name: Notify Feishu on Failure
36+
runs-on: ubuntu-latest
37+
if: failure()
38+
steps:
39+
- name: Send notification to Feishu on failure
40+
run: |
41+
curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \
42+
-H 'Content-Type: application/json' \
43+
-d '{
44+
"msg_type": "text",
45+
"content": {
46+
"text": "⚠️ GitHub Action 失败通知:自动合并 PR 时失败,请检查!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 详情: ${{ github.event.head_commit.message }}\n- [查看日志](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
47+
}
48+
}'

.github/workflows/auto_update_release_notes.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,19 @@ jobs:
172172
labels: |
173173
release_notes_with_toc
174174
auto_merge
175+
176+
notify-feishu-on-failure:
177+
name: Notify Feishu on Failure
178+
runs-on: ubuntu-latest
179+
if: failure()
180+
steps:
181+
- name: Send notification to Feishu on failure
182+
run: |
183+
curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \
184+
-H 'Content-Type: application/json' \
185+
-d '{
186+
"msg_type": "text",
187+
"content": {
188+
"text": "🚨 GitHub Action 失败通知:从飞书更新 Release Notes 并发起 PR 时失败!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 详情: ${{ github.event.head_commit.message }}\n- [查看日志](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
189+
}
190+
}'

.github/workflows/dispatch.prod.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,19 @@ jobs:
2828
repository: merico-dev/website-docs
2929
event-type: ${{ github.repository }}/${{ github.ref_name }}-${{ steps.extract.outputs.sha }}
3030
client-payload: '{ "repo": "${{ github.repository }}", "ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "env": "prod" }'
31+
32+
notify-feishu-on-failure:
33+
name: Notify Feishu on Failure
34+
runs-on: ubuntu-latest
35+
if: failure()
36+
steps:
37+
- name: Send notification to Feishu on failure
38+
run: |
39+
curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \
40+
-H 'Content-Type: application/json' \
41+
-d '{
42+
"msg_type": "text",
43+
"content": {
44+
"text": "🚨 GitHub Action 失败通知:官网文档分发失败!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 详情: ${{ github.event.head_commit.message }}\n- [查看日志](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
45+
}
46+
}'

.github/workflows/dispatch.staging.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,19 @@ jobs:
2323
repository: merico-dev/website-docs
2424
event-type: ${{ github.repository }}/${{ github.ref_name }}-${{ steps.extract.outputs.sha }}
2525
client-payload: '{ "repo": "${{ github.repository }}", "ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}", "env": "staging" }'
26+
27+
notify-feishu-on-failure:
28+
name: Notify Feishu on Failure
29+
runs-on: ubuntu-latest
30+
if: failure()
31+
steps:
32+
- name: Send notification to Feishu on failure
33+
run: |
34+
curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \
35+
-H 'Content-Type: application/json' \
36+
-d '{
37+
"msg_type": "text",
38+
"content": {
39+
"text": "⚠️ GitHub Action 失败通知:官网文档分发预演失败!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 详情: ${{ github.event.head_commit.message }}\n- [查看日志](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
40+
}
41+
}'

.github/workflows/generate_pdf_and_upload.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,19 @@ jobs:
9393
# Step 12: 清理 SSH key
9494
- name: Clean up SSH key
9595
run: rm -f ~/.ssh/id_rsa
96+
97+
notify-feishu-on-failure:
98+
name: Notify Feishu on Failure
99+
runs-on: ubuntu-latest
100+
if: failure()
101+
steps:
102+
- name: Send notification to Feishu on failure
103+
run: |
104+
curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \
105+
-H 'Content-Type: application/json' \
106+
-d '{
107+
"msg_type": "text",
108+
"content": {
109+
"text": "🚨 GitHub Action 失败通知:生成 PDF 文档并上传时失败!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 详情: ${{ github.event.head_commit.message }}\n- [查看日志](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
110+
}
111+
}'

0 commit comments

Comments
 (0)