Skip to content

Commit

Permalink
Uncommented slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandhya1874 committed Oct 11, 2024
1 parent 4e1505a commit 9185f7d
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/deploy_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ jobs:
namespace: ${{ secrets.KUBE_NAMESPACE }}
token: ${{ secrets.KUBE_TOKEN }}

# # slack_notify:
# # name: Notify slack if deploy_env job failed
# # runs-on: ubuntu-latest
# # if: ${{ steps.deploy_env.outcome == 'failure' }}
# # steps:
# # - name: Notify slack on failure of job
# # uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
# # if: ${{ inputs.channel_id != 'NO_SLACK' }}
# # with:
# # channel-id: ${{ inputs.channel_id }}
# # 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 }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
# # }
# # }
# # ]
# # }
# # env:
# # SLACK_BOT_TOKEN: ${{ secrets.HMPPS_SRE_SLACK_BOT_TOKEN }}
slack_notify:
name: Notify slack if deploy_env job failed
runs-on: ubuntu-latest
if: ${{ steps.deploy_env.outcome == 'failure' }}
steps:
- name: Notify slack on failure of job
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
if: ${{ inputs.channel_id != 'NO_SLACK' }}
with:
channel-id: ${{ inputs.channel_id }}
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 }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.HMPPS_SRE_SLACK_BOT_TOKEN }}

0 comments on commit 9185f7d

Please sign in to comment.