Use underscore delimiter for flattening #281
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #280.
Summary
The default key delimiter when flattening payloads is a period, which is not allowed in Slack workflow variable keys. This makes the
slack-send
action unusable with Slack workflows/incoming webhooks if the payload contains nested keys as there is no way to access those keys (as far as I can tell).For example if I want to include workflow metadata from GitHub in my payload with
${{ toJson(github) }}
, all nested keys are inaccessible, and if I want to compose this with other custom variables by nesting the serializedgithub
values like"github": ${{ toJson(github) }}, "some-key": "some-value"
, then all of the GitHub metadata is inaccessible because it's all prefixed withgithub.
and can't be entered as a variable key in a Slack workflow. Underscores and hyphens are both valid, so changing to an underscore makes all those nested keys accessible. Seeflat
docsTested on a private workflow by building and calling the action directly from my branch.
Requirements (place an
x
in each[ ]
)