@@ -11,15 +11,26 @@ jobs:
11
11
- name : Checkout repository
12
12
uses : actions/checkout@v4
13
13
14
- - name : Make script executable
15
- shell : bash
14
+ - name : Write HTML body to file
16
15
run : |
17
- chmod +x ./.github/workflows/scripts/notify-nightly-failure.js
16
+ cat > ./email-body.html <<EOF
17
+ <h3>Nightly Trigger workflow has failed, see details:</h3>
18
+ <ul>
19
+ <li><strong>Workflow :</strong> ${{ github.workflow }}</li>
20
+ <li><strong>Repository :</strong> ${{ github.repository }}</li>
21
+ <li><strong>Run Number :</strong> #${{ github.run_number }}</li>
22
+ <li><strong>Logs :</strong> <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}">Check logs</a></li>
23
+ </ul>
24
+ EOF
18
25
19
- - name : Send failure notification by email
20
- uses : peter-evans/sendgrid-action@v1
21
- env :
22
- SENDGRID_API_KEY : ${{ secrets.SENDGRID_API_KEY }}
23
- SCRIPT_FILEPATH : ./.github/workflows/scripts/notify-nightly-failure.js
24
- SENDGRID_MAIL_FROM : ${{ secrets.CI_NOTIFICATION_EMAIL_FROM }}
25
- SENDGRID_MAIL_TO : ${{ secrets.CI_NOTIFICATION_EMAIL_TO }}
26
+ - name : Send failure notification via Mailgun
27
+ uses : dawidd6/action-send-mail@v6
28
+ with :
29
+ server_address : ${{ vars.CI_NOTIFICATION_SMTP_SERVER }}
30
+ server_port : ${{ vars.CI_NOTIFICATION_SMTP_PORT }}
31
+ username : ${{ secrets.CI_NOTIFICATION_SMTP_LOGIN }}
32
+ password : ${{ secrets.CI_NOTIFICATION_SMTP_PASSWORD }}
33
+ subject : " 🚨 Nightly Workflow Failed"
34
+ to : ${{ secrets.CI_NOTIFICATION_EMAIL_TO }}
35
+ from : ${{ secrets.CI_NOTIFICATION_EMAIL_FROM }}
36
+ html_body : file://email-body.html
0 commit comments