Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolina authored Aug 30, 2024
1 parent 2b5ee14 commit bf2eb32
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/actions/core-cicd/notification/notify-slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,30 @@ runs:
using: "composite"
steps:
- name: Slack Notification
uses: slackapi/[email protected]
if: inputs.json == 'false'
uses: slackapi/[email protected]
with:
channel-id: ${{ inputs.channel-id }}
payload: ${{ inputs.json == 'true' && inputs.payload || '{\"blocks\":[{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"HELLO WORLD\"}}]}' }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ${{ toJSON(inputs.payload) }}
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-bot-token }}

- name: Slack Notification with JSON
if: inputs.json == 'true'
uses: slackapi/[email protected]
with:
channel-id: ${{ inputs.channel-id }}
payload: ${{ inputs.payload }}
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-bot-token }}

0 comments on commit bf2eb32

Please sign in to comment.