From 82eddfea1ead872519f9cd9971b27367b0b35138 Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com> Date: Mon, 7 Jul 2025 14:10:29 -0500 Subject: [PATCH] Added Slack failure notification to the new Collect engineering metrics job. (#30566) Fixes #29140 I intended to add a Slack notification but forgot in the previous PR. ## Summary by CodeRabbit * **Chores** * Added automated Slack notifications for failed scheduled workflow runs. --- .github/workflows/collect-eng-metrics.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/collect-eng-metrics.yml b/.github/workflows/collect-eng-metrics.yml index f02d8f1c32..908c4692f6 100644 --- a/.github/workflows/collect-eng-metrics.yml +++ b/.github/workflows/collect-eng-metrics.yml @@ -53,3 +53,24 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SERVICE_ACCOUNT_KEY_PATH: './service-account-key.json' + + - name: Slack notification + if: github.event_name == 'schedule' && failure() + uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 + with: + payload: | + { + "text": "${{ job.status }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Collect engineering metrics result: ${{ job.status }}\nhttps://github.com/fleetdm/fleet/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_G_HELP_ENGINEERING_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK