From 15636cd76098baa024fd75c2306debd8baa5870f Mon Sep 17 00:00:00 2001 From: Lucas Manuel Rodriguez Date: Fri, 22 Apr 2022 14:39:55 -0300 Subject: [PATCH] Add slack notif when integration test fails (#5332) --- .github/workflows/integration.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 252c83810c..575f92d3c6 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -80,6 +80,27 @@ jobs: ./build/fleetctl get hosts echo "Success! $EXPECTED hosts enrolled." + - name: Slack Notification + if: failure() + uses: slackapi/slack-github-action@16b6c78ee73689a627b65332b34e5d409c7299da # v1.18.0 + with: + payload: | + { + "text": "${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Integration test result: ${{ job.status }}\nhttps://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}\n${{ github.event.pull_request.html_url || github.event.head.html_url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CORE_ENGINEERING_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + - name: Cleanup tunnel if: always() run: cloudflared tunnel --origincert cert.pem delete --force ${{ needs.gen.outputs.subdomain }}