forked from Submitty/Submitty
-
Notifications
You must be signed in to change notification settings - Fork 1
23 lines (22 loc) · 1 KB
/
notify_main_fail.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
name: Notify on Main Failure
on:
workflow_run:
workflows: [Submitty CI]
types: [completed]
branches:
- 'main'
jobs:
Notify-Failure:
if: ${{ github.event.workflow_run.head_repository.full_name == 'Submitty/Submitty' }}
runs-on: ubuntu-latest
steps:
- name: Send notification to Zulip on failure
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
run: |
curl -X POST https://submitty.zulipchat.com/api/v1/messages -u ${{ secrets.ZULIP_AUTHENTICATION }} --data-urlencode 'type=stream' --data-urlencode 'to=Submitty Developer Studio' \
--data-urlencode 'topic=Main CI Failures' --data-urlencode \
'content=The Github Actions CI has failed on the Main branch, View here: [Main CI](https://github.com/Submitty/Submitty/actions/runs/${{ github.event.workflow_run.id }})'
- name: Echo success message
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: |
echo "All Tests have passed"