From 95341cd1af805f593f4bc4c82420b8f13c529496 Mon Sep 17 00:00:00 2001 From: Harsh Singhvi Date: Sat, 18 Nov 2023 14:14:29 +0530 Subject: [PATCH] Slack notificaiton github workflows --- .github/workflows/docker-image.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 01c6fb3..1b11a93 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -29,3 +29,31 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: ghcr.io/harshsinghvi/golang-postgres-kubernetes:latest + - name: Send custom JSON data to Slack workflow + id: slack + uses: slackapi/slack-github-action@v1.24.0 + with: + # This data can be any valid JSON from a previous step in the GitHub Action + payload: | + { + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "🚀 go-todo-api image pushed" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK