From 0209958475b9b6bcf8276122a3a211d073a2c4d1 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 14 Jul 2021 17:17:31 -0700 Subject: [PATCH] Fix generate-docs github action to send email when it fails --- .github/workflows/generate-docs.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 2af81d487c..a940523edf 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -3,9 +3,6 @@ name: Generate Documentation on: schedule: - cron: '0 0 * * *' - push: - branches: - - topic/timw/send-email-on-docs-action-failure jobs: generate: @@ -95,3 +92,16 @@ jobs: git add doc git status git commit -m 'Update doc submodule [nomail] [skip ci]' && git push auth master || /bin/true + + - name: Send email + if: failure() + uses: dawidd6/action-send-mail@v3.4.1 + with: + server_address: ${{secrets.SMTP_HOST}} + server_port: ${{secrets.SMTP_PORT}} + username: ${{secrets.SMTP_USER}} + password: ${{secrets.SMTP_PASS}} + subject: generate-docs Github Action failed! + body: generate-docs job of ${{github.repository}} Failed! See https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} for details. + to: ${{secrets.MAIL_TO}} + from: Github Actions <${{secrets.MAIL_FROM}}>