From 1a4729b01d1e7be9cf5b532d6b5615b2d9041d24 Mon Sep 17 00:00:00 2001 From: Melissa DeLucchi <113376043+delucchi-cmu@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:03:41 -0400 Subject: [PATCH] Add smoke test failure notification to lincc-dev channel. (#470) --- .github/workflows/smoke-test.yml | 39 +++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 17b96f78..6db50b20 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -38,4 +38,41 @@ jobs: pip list - name: Run unit tests with pytest / pytest-copie run: | - python -m pytest \ No newline at end of file + python -m pytest + - name: Send status to Slack app + if: ${{ failure() && github.event_name != 'workflow_dispatch' }} + id: slack + uses: slackapi/slack-github-action@v1 + with: + payload: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "${{ github.repository }}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: *${{ job.status }}* :${{ job.status }}:" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK \ No newline at end of file