Email on Failure #122
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: 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 }} |