Skip to content

Commit

Permalink
fix(deployment): Edit Page V2 Automate the deploy of the SDK librar (#…
Browse files Browse the repository at this point in the history
…28259) (#29832)

### Proposed Changes
* This pull request updates the function sends Slack notifications using
slackapi/[email protected], handling both plain text messages
and preformatted JSON payloads. It dynamically selects the appropriate
format based on a boolean input (json), ensuring correct handling of
Slack message formatting and maintaining compatibility with different
notification types.

### Additional Info
Related to #28259 (Edit Page V2 Automate the deploy of the SDK librar).
  • Loading branch information
dcolina authored and dsolistorres committed Sep 18, 2024
1 parent 2da86a8 commit 7123a26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/actions/core-cicd/notification/notify-slack/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ inputs:
slack-bot-token:
description: 'Slack Bot Token'
required: true
json:
description: 'Boolean flag to indicate if the payload is already a JSON object'
required: false
default: 'false'

runs:
using: "composite"
steps:
- name: Slack Notification
if: inputs.json == 'false'
uses: slackapi/[email protected]
with:
channel-id: ${{ inputs.channel-id }}
Expand All @@ -32,3 +37,12 @@ runs:
}
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 }}
1 change: 1 addition & 0 deletions .github/workflows/cicd_post-workflow-reporting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,5 @@ jobs:
with:
channel-id: ${{ vars.SLACK_REPORT_CHANNEL }}
payload: ${{ steps.prepare-slack-message.outputs.payload }}
json: true
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit 7123a26

Please sign in to comment.