how does one send a message with a snippet?
Description
I'd like to send a nice snippet of code in a message instead of markdown code block.
This is what I do now:
This is what I want:
Im not quite sure how to do it and will appreciate any guiding
What type of issue is this? (place an x in one of the [ ])
- [ ] bug
- [x] enhancement (feature request)
- [x] question
- [ ] documentation related
- [ ] example code related
- [ ] testing related
- [ ] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Hi @iamstarkov! 👋 Thanks for sharing the example! The second snippet is showing a file upload with a specific file type instead of block kit blocks or other formatting, which isn't yet possible, but it is good to know of some workaround for this right now.
Support for this is in progress (#333) and also tracked in #92, but let's keep this open since this seems like a useful case to have documented 📚 🙏
This is now possible with the @2.0.0 release! Details on updating are included with that link, but a step like so might be helpful for sending snippets:
- name: Share a file to that channel
uses: slackapi/[email protected]
with:
method: files.uploadV2
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
file: "./path/to/api.json"
filename: "api.json"
I'm going to close this issue for now, but please feel free to comment with follow ups or open another whenever! 🙏