Skip to content

Notify on Main Failure #4

Notify on Main Failure

Notify on Main Failure #4

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"