Notify on Main Failure #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |