-
Notifications
You must be signed in to change notification settings - Fork 4.4k
37 lines (34 loc) · 1.15 KB
/
build-notify.yml
File metadata and controls
37 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: BuildNotify
on:
workflow_run:
workflows:
- CI
- Release
- Canary
types: [completed]
jobs:
notify:
if: >
github.event.workflow_run.head_repository.full_name == github.repository &&
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"