Skip to content

Commit

Permalink
Make the payload delimiter configurable
Browse files Browse the repository at this point in the history
This reverts the default payload delimiter to a period and allows setting the `payload-delimiter` option to override it.
  • Loading branch information
rzumer authored Jun 18, 2024
1 parent 2c6a605 commit ed78a8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/slack-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ module.exports = async function slackSend(core) {
}

if (webhookType === SLACK_WEBHOOK_TYPES.WORKFLOW_TRIGGER) {
// flatten JSON payload (no nested attributes), with nested keys delimited with underscores.
const flatPayload = flatten(payload, { delimiter: '_' });
// flatten JSON payload (no nested attributes).
const payloadDelimiter = core.getInput('payload-delimiter') || '.';
const flatPayload = flatten(payload, { delimiter: payloadDelimiter });

// workflow builder requires values to be strings
// iterate over every value and convert it to string
Expand Down

0 comments on commit ed78a8e

Please sign in to comment.