aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/cirrus-notify.yml
blob: bbc84bf93bb2e293ef94021e4df01b05a04bed3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
on:
  check_suite:
    type: ['completed']
name: Cirrus CI failure notification
jobs:
  cirrus-notify:
    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'
    runs-on: ubuntu-latest
    steps:
      - name: Dump GitHub context
        env:
          GITHUB_CONTEXT: ${{ toJson(github) }}
        run: echo "$GITHUB_CONTEXT"
      - uses: ruby/action-slack@v3.0.0
        with:
          payload: |
            {
              "ci": "Cirrus CI",
              "env": "Cirrus CI",
              "url": "https://github.com/ruby/ruby/actions/runs/${{ github.run_id }}",
              "commit": "${{ github.event.check_suite.head_commit.id }}",
              "branch": "${{ github.event.check_suite.head_branch }}"
            }
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
        # head_branch can be null. checking it here to see GITHUB_CONTEXT on master.
        if: ${{ github.event.check_suite.head_branch == 'master' }}