|
|
@@ -132,3 +132,25 @@ jobs:
|
|
|
if [ "${{ matrix.goos }}" = "linux" ]; then
|
|
|
gh release upload "$RELEASE_TAG" dist/gogs_*.tar.gz --clobber
|
|
|
fi
|
|
|
+
|
|
|
+ notify-failure:
|
|
|
+ name: Notify on failure
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ needs: [build]
|
|
|
+ if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
|
+ steps:
|
|
|
+ - name: Send email on failure
|
|
|
+ uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
|
|
|
+ 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 }}
|