File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 run : cmake -S . -B build -G Ninja
4141 - name : Build
4242 run : cmake --build build
43+ - name : Discord notification
44+ if : always() && env.DISCORD_WEBHOOK_URL != ''
45+ shell : pwsh
46+ env :
47+ DISCORD_WEBHOOK_URL : ${{ secrets.DISCORD_WEBHOOK_URL }}
48+ run : |
49+ $status = if ("${{ job.status }}" -eq "success") { "Success" } else { "Failure" }
50+ $color = if ("${{ job.status }}" -eq "success") { 3066993 } else { 15158332 }
51+ $title = "Linux build $status"
52+ $runUrl = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
53+ $payload = @{
54+ username = "GitHub Actions"
55+ embeds = @(
56+ @{
57+ title = $title
58+ url = $runUrl
59+ color = $color
60+ fields = @(
61+ @{ name = "Commit"; value = "${{ github.sha }}"; inline = $true }
62+ @{ name = "Branch"; value = "${{ github.ref_name }}"; inline = $true }
63+ )
64+ }
65+ )
66+ } | ConvertTo-Json -Depth 5
67+
68+ Invoke-RestMethod -Method Post -Uri $env:DISCORD_WEBHOOK_URL -ContentType "application/json" -Body $payload
Original file line number Diff line number Diff line change 6060 with :
6161 name : OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest
6262 path : OpenFodder-${{ matrix.arch }}-${{ matrix.configuration }}-latest.zip
63+ - name : Discord notification
64+ if : always() && env.DISCORD_WEBHOOK_URL != ''
65+ shell : pwsh
66+ env :
67+ DISCORD_WEBHOOK_URL : ${{ secrets.DISCORD_WEBHOOK_URL }}
68+ run : |
69+ $status = if ("${{ job.status }}" -eq "success") { "Success" } else { "Failure" }
70+ $color = if ("${{ job.status }}" -eq "success") { 3066993 } else { 15158332 }
71+ $title = "Windows build $status (${{ matrix.arch }})"
72+ $runUrl = "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
73+ $payload = @{
74+ username = "GitHub Actions"
75+ embeds = @(
76+ @{
77+ title = $title
78+ url = $runUrl
79+ color = $color
80+ fields = @(
81+ @{ name = "Commit"; value = "${{ github.sha }}"; inline = $true }
82+ @{ name = "Branch"; value = "${{ github.ref_name }}"; inline = $true }
83+ @{ name = "Config"; value = "${{ matrix.configuration }}"; inline = $true }
84+ )
85+ }
86+ )
87+ } | ConvertTo-Json -Depth 5
88+
89+ Invoke-RestMethod -Method Post -Uri $env:DISCORD_WEBHOOK_URL -ContentType "application/json" -Body $payload
You can’t perform that action at this time.
0 commit comments