Skip to content

Commit

Permalink
Add Github email notification
Browse files Browse the repository at this point in the history
  • Loading branch information
n1hility committed Mar 16, 2024
1 parent 28ad4c9 commit 9c0f75a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/email.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
check_suite:
type: ['completed']

name: Email about Cirrus CI failures
jobs:
continue:
name: After Cirrus CI Failure
if: >-
github.event.check_suite.app.name == 'Cirrus CI'
&& github.event.check_suite.conclusion != 'success'
&& github.event.check_suite.conclusion != 'cancelled'
&& github.event.check_suite.conclusion != 'skipped'
&& github.event.check_suite.conclusion != 'neutral'
runs-on: ubuntu-latest
steps:
- uses: octokit/[email protected]
id: get_failed_check_run
with:
route: GET /repos/${{ github.repository }}/check-suites/${{ github.event.check_suite.id }}/check-runs?status=completed
mediaType: '{"previews": ["antiope"]}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
echo "Cirrus CI ${{ github.event.check_suite.conclusion }} on ${{ github.event.check_suite.head_branch }} branch!"
echo "SHA ${{ github.event.check_suite.head_sha }}"
echo $MESSAGE
echo "##[error]See $CHECK_RUN_URL for details" && false
env:
CHECK_RUN_URL: ${{ fromJson(steps.get_failed_check_run.outputs.data).check_runs[0].html_url }}

0 comments on commit 9c0f75a

Please sign in to comment.