Skip to content

Commit cc3529a

Browse files
committed
Attempt to add Discord notification on CI run
1 parent 657f8f2 commit cc3529a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/pure.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,24 @@ jobs:
231231
gh release create ${{ env.VERSION }} --repo cakeml/pure --latest --notes-file $COMMITS pure.S
232232
rm -f pure.S $COMMITS
233233
234+
notify:
235+
needs: build
236+
runs-on: self-hosted
237+
container: ubuntu:20.04
238+
if: ${{ always() }}
239+
240+
steps:
241+
- name: Notify CakeML Discord
242+
run: >
243+
curl --silent --show-error --request POST
244+
--header "Content-type: application/json;charset=utf-8"
245+
--data "{\"embeds\": [{
246+
\"title\": \"CI #${{ github.run_number }}\",
247+
\"description\": \"${{ needs.build.result == 'success' && 'Passed' || 'Failed' }}\",
248+
\"url\": \"https://github.com/CakeML/pure/actions/runs/${{ github.run_id }}\",
249+
\"color\": ${{ needs.build.result == 'success' && 8311585 || 13632027 }},
250+
\"author\": {
251+
\"name\": \"PureCake CI\",
252+
\"url\": \"https://github.com/CakeML/pure/actions/workflows/pure.yml\"}
253+
}]}"
254+
${{ secrets.DISCORD_WEBHOOK }}

0 commit comments

Comments
 (0)