Skip to content

Email on Failure

Email on Failure #122

Workflow file for this run

name: Email on Failure
on:
workflow_run:
workflows: ["DNS", "Websites"]
types:
- completed
jobs:
email:
name: Send mail
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Send mail
uses: dawidd6/action-send-mail@v2
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: External test failed - ${{ github.event.workflow_run.name }}
to: sc-admin@swin.edu.au
from: ${{ secrets.MAIL_USERNAME }}
body: |
Test ${{ github.event.workflow_run.name }} failed.
Check the workflow at: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}