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 31f83c4 commit 9acd775
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions .github/actions/core-cicd/notification/notify-slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,9 @@ runs:
using: "composite"
steps:
- name: Slack Notification
if: inputs.json == 'false'
uses: slackapi/[email protected]
with:
channel-id: ${{ inputs.channel-id }}
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 }}
payload: ${{ inputs.json == 'true' && inputs.payload || toJSON(format('{"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": {0}}}] }', inputs.payload)) }}
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-bot-token }}

0 comments on commit 9acd775

Please sign in to comment.