diff options
author | Joe Chen <jc@unknwon.io> | 2021-12-18 11:15:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-18 11:15:02 +0800 |
commit | 6528bf35dc2cb93c10165bc890073839a8ecd944 (patch) | |
tree | 210c75237c3e549cee2d4a5e7a69aeaecf380921 /.github | |
parent | da56873d37edce3c09e0cf020bdc91d2cc966ec8 (diff) |
ci: send emails on job failures for Docker and Go (#6679)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/docker.yml | 16 | ||||
-rw-r--r-- | .github/workflows/go.yml | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2db0708a..57655822 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -75,3 +75,19 @@ jobs: tags: | gogs/gogs:latest ghcr.io/gogs/gogs:latest + - name: Send email on failure + uses: dawidd6/action-send-mail@v3 + if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + server_address: smtp.mailgun.org + server_port: 465 + username: ${{ secrets.SMTP_USERNAME }} + password: ${{ secrets.SMTP_PASSWORD }} + subject: GitHub Actions (${{ github.repository }}) job result + to: github-actions-8ce6454@unknwon.io + from: GitHub Actions (${{ github.repository }}) + reply_to: noreply@unknwon.io + body: | + The job "${{ github.job }}" of ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} completed with "${{ job.status }}". + + View the job run at: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6a3509ad..143a462a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -52,3 +52,19 @@ jobs: with: file: ./coverage flags: unittests + - name: Send email on failure + uses: dawidd6/action-send-mail@v3 + if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + server_address: smtp.mailgun.org + server_port: 465 + username: ${{ secrets.SMTP_USERNAME }} + password: ${{ secrets.SMTP_PASSWORD }} + subject: GitHub Actions (${{ github.repository }}) job result + to: github-actions-8ce6454@unknwon.io + from: GitHub Actions (${{ github.repository }}) + reply_to: noreply@unknwon.io + body: | + The job "${{ github.job }}" of ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} completed with "${{ job.status }}". + + View the job run at: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |