Skip to content

Commit

Permalink
Use underscore delimiter for flattening
Browse files Browse the repository at this point in the history
The default key delimiter when flattening payloads is a period, which is not allowed in Slack workflow variable keys.
  • Loading branch information
rzumer authored Jan 17, 2024
1 parent 84a8f7d commit 2c6a605
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/slack-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ module.exports = async function slackSend(core) {
}

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

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

0 comments on commit 2c6a605

Please sign in to comment.