name: Cirrus CI failures

on:
  check_run:
    type: ['completed']

jobs:
  send-failure-notification-to-zulip:
    name: Send Cirrus CI failure to Zulip
    if: github.event.check_run.app.name == 'Cirrus CI' && github.event.check_run.conclusion == 'failure' && toJson(github.event.check_run.pull_requests) == '[]'
    runs-on: ubuntu-latest
    steps:
      - name: Send
        uses: zulip/github-actions-zulip@35d7ad8e98444f894dcfe1d4e17332581d28ebeb
        with:
          api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
          email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
          organization-url: 'https://ponylang.zulipchat.com/'
          to: notifications
          type: stream
          topic: ${{ github.repository }} scheduled job failure
          content: ${{ github.event.check_run.details_url }} failed.

name: Cirrus CI failures

on:
  check_run:
    type: ['completed']

jobs:
  send-failure-notification-to-zulip:
    name: Send Cirrus CI failure to Zulip
    if: github.event.check_run.app.name == 'Cirrus CI' && github.event.check_run.conclusion == 'failure' && toJson(github.event.check_run.pull_requests) == '[]'
    runs-on: ubuntu-latest
    steps:
      - name: Log event
        run: echo "$EVENT"
        env:
          EVENT: ${{ toJson(github.event) }}
      - name: Send
        uses: zulip/github-actions-zulip@35d7ad8e98444f894dcfe1d4e17332581d28ebeb
        with:
          api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
          email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
          organization-url: 'https://ponylang.zulipchat.com/'
          to: notifications
          type: stream
          topic: ${{ github.repository }} scheduled job failure
          content: ${{ github.event.check_run.details_url }} failed.

Add logging of GH event for any failure alerts we send to Zulip
Add logging of GH event for any failure alerts we send to Zulip

We are getting some alerts for PRs that we shouldn't. It looks like
it might be because the PR is coming from a fork.
