Skip to content

Commit

Permalink
Adding Slack Notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayasimha Raghavan authored and Jayasimha Raghavan committed Feb 3, 2024
1 parent 8152fcf commit be98821
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion .github/workflows/custom-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,48 @@ jobs:
else
echo "$directory is not empty, custom legos are detected!"
exit 1
fi
fi

- name: Notify on Slack (Success case)
if: success()
uses: slackapi/[email protected]
with:
# For posting a rich message using Block Kit
channel-id: "${{ secrets.SLACK_CHANNEL_ID }}"
payload: |
{
"text": "GitHub Action build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":tada: Custom Docker Build Verification for ${{ steps.get_tag.outputs.current_tag }} successful "
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

- name: Notify on Slack (Failure case)
if: failure()
uses: slackapi/[email protected]
with:
# For posting a rich message using Block Kit
channel-id: "${{ secrets.SLACK_CHANNEL_ID }}"
payload: |
{
"text": "GitHub Action build result: ${{ job.status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":no-entry: Attention! Custom Docker Build Verification for ${{ steps.get_tag.outputs.current_tag }} Failed! "
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit be98821

Please sign in to comment.