added build notify (#6891)

This commit is contained in:
Lifei Zhou
2026-02-09 14:22:01 +11:00
committed by GitHub
parent 1371f5df4a
commit 5f183a63c6
+35
View File
@@ -0,0 +1,35 @@
name: BuildNotify
on:
workflow_run:
workflows:
- CI
- Release
types: [completed]
jobs:
notify:
if: >
github.event.workflow_run.conclusion == 'failure' &&
(
github.event.workflow_run.name != 'CI' ||
github.event.workflow_run.head_branch == 'main' ||
github.event.workflow_run.event == 'merge_group'
)
runs-on: ubuntu-latest
steps:
- name: Notify Discord
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_GOOSE_STATUS }}
run: |
curl -sS --fail-with-body -H "Content-Type: application/json" \
-d '{
"embeds": [{
"title": "❌ Build Failed",
"description": "**Workflow:** ${{ github.event.workflow_run.name }}\n**Branch:** ${{ github.event.workflow_run.head_branch }}\n**Commit:** ${{ github.event.workflow_run.head_sha }}",
"url": "${{ github.event.workflow_run.html_url }}",
"color": 15158332
}]
}' \
"$DISCORD_WEBHOOK_URL"