File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Notify when daily build fails
2+ on :
3+ workflow_run :
4+ workflows : ['CI']
5+ types : [completed]
6+ branches : [main]
7+
8+ jobs :
9+ on-failure :
10+ runs-on : ubuntu-latest
11+ if : github.event.workflow_run.conclusion != 'success' && github.event.workflow_run.event == 'schedule'
12+ steps :
13+ - uses : actions/github-script@v6
14+ id : job-url
15+ with :
16+ script : |
17+ const { data } = await github.rest.actions.listJobsForWorkflowRunAttempt({
18+ ...context.repo,
19+ run_id: context.runId,
20+ attempt_number: process.env.GITHUB_RUN_ATTEMPT
21+ });
22+ return data.jobs[0].html_url
23+ result-encoding : string
24+ 25+ with :
26+ host : ${{ secrets.NOTIFICATION_SMTP_SERVER }}
27+ port : 465
28+ username : ' ${{ secrets.NOTIFICATION_SMTP_USER }}'
29+ password : ' ${{ secrets.NOTIFICATION_SMTP_PASSWORD }}'
30+ from : ' Grafana notifications <${{ secrets.NOTIFICATION_SMTP_USER }}>'
31+ to : ' ${{ secrets.NOTIFICATION_DESTINATION }}'
32+ subject : ' 🔴 Grafana data source plugin nightly build failed'
33+
34+ body : |
35+ <p>The latest Grafana's data source plugin nightly build has failed and needs manual intervention. Additional information:</p>
36+ <ul>
37+ <li><strong>Process conclussion</strong>: ${{ github.event.workflow_run.conclusion }}</li>
38+ <li><strong>More information</strong>: ${{ steps.job-url.outputs.result }}</li>
39+ </ul>
40+ <p>Thank you!</p>
You can’t perform that action at this time.
0 commit comments