Email about Cirrus CI failures #6842
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2020-2023 by the Zeek Project. See LICENSE for details. | |
on: | |
check_suite: | |
types: | |
- completed | |
name: Email about Cirrus CI failures | |
jobs: | |
continue: | |
name: After Cirrus CI Failure | |
if: github.event.check_suite.app.name == 'Cirrus CI' && contains(fromJson('["failure", "timed_out", "action_required", "startup_failure"]'), github.event.check_suite.conclusion) | |
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 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 }} |