mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
Add GitHub Action to send email for Cirrus CI failures
This commit is contained in:
parent
bb3fb0115a
commit
effe5bccbf
26
.github/workflows/cirrus_email.yml
vendored
Normal file
26
.github/workflows/cirrus_email.yml
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
name: Email about Cirrus CI failures
|
||||||
|
|
||||||
|
on:
|
||||||
|
check_suite:
|
||||||
|
type: ['completed']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
continue:
|
||||||
|
name: After Cirrus CI Failure
|
||||||
|
if: github.event.check_suite.app.name == 'Cirrus CI' && github.event.check_suite.conclusion != 'success'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: octokit/request-action@v2.x
|
||||||
|
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 }}
|
Loading…
Reference in New Issue
Block a user