https://bitbucket.org/atlassian/slack-notify/src/master/
Currently, we're using the slack notify pipe in order to add additional context. This pipe provides a way of providing a simple message, or a Block Kit style message.
However, what we typically want to do is provide a multi-line plain-text file as part of the message.
Unfortunately, this is somewhat of a tricky thing to do, as the naive approach with the `MESSAGE` parameter and `PAYLOAD_FILES` can be difficult.
Example 1: using the MESSAGE parameter
- pipe: atlassian/slack-notify:1.0.2
variables:
WEBHOOK_URL: $SLACK_WEBHOOK_URL
PRETEXT: 'Releasing!'
MESSAGE: >
$(cat output.txt)
I believe this does not work as output.txt ends up breaking interpretation of the yaml file.
Example 2: using the PAYLOAD_FILES parameter
Using this parameter requires massaging this multi-line file in order to get it to show up, and can be quite confusing without dropping into a full programming language.
My request
It would be nice if the documentation provided an example which demonstrates how to provide a simple multi-line text file as either a MESSAGE parameter or a the PAYLOAD_FILES, or add a new parameter to support the common case of wanting to provide a text file as a message in slack.
@Will Marsman hi. Thanks for your suggestion.
To cover your case check this reference of how to attach file.
Regards, Igor
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.