-
Notifications
You must be signed in to change notification settings - Fork 17
46 lines (43 loc) · 1.69 KB
/
Copy pathwarn.yml
File metadata and controls
46 lines (43 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Notify when daily build fails
on:
workflow_run:
workflows: ['CI']
types: [completed]
branches: [main]
jobs:
on-failure:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'success' && github.event.workflow_run.event == 'schedule'
steps:
- uses: actions/github-script@v6
id: job-url
with:
script: |
const { data } = await github.rest.actions.listJobsForWorkflowRunAttempt({
...context.repo,
run_id: context.runId,
attempt_number: process.env.GITHUB_RUN_ATTEMPT
});
return data.jobs[0].html_url
result-encoding: string
- name: Send mail
uses: dawidd6/action-send-mail@v6
with:
server_address: ${{ secrets.NOTIFICATION_SMTP_SERVER }}
server_port: 465
secure: true
ignore_cert: false
username: '${{ secrets.NOTIFICATION_SMTP_USER }}'
password: '${{ secrets.NOTIFICATION_SMTP_PASSWORD }}'
from: 'Grafana notifications <${{ secrets.NOTIFICATION_SMTP_USER }}>'
to: '${{ secrets.NOTIFICATION_DESTINATION }}'
subject: '🔴 Grafana data source plugin nightly build failed'
body: |
<p>The latest Grafana's data source plugin nightly build has failed and needs manual intervention. Additional information:</p>
<ul>
<li><strong>Process conclussion</strong>: ${{ github.event.workflow_run.conclusion }}</li>
<li><strong>More information</strong>: ${{ steps.job-url.outputs.result }}</li>
</ul>
<p>Thank you!</p>
#nodemailerlog: false
#nodemailerdebug: false