slackapi / slackapi/slack-github-action
Markdown blocks are not sending with incoming webhooks
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.3k
- Forks
- 200
- Avg merge
- 2h 59m
- Merged PRs (30d)
- 6
Description
Hey folks, I'm trying to send a message with some markdown in it, but its not being honored.
According to the reference these should work?
https://api.slack.com/reference/block-kit/blocks#markdown
Here's my example with inline blocks
- name: Announce Release
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.MY_SECRET }}
webhook-type: incoming-webhook
errors: true
payload: |
text: "New Release: Shared Helm Chart: 1.2.3"
blocks:
- type: header
text:
type: plain_text
text: ":tada: New Release: Shared Helm Chart: 1.2.3"
- type: divider
- type: section
text:
type: mrkdwn
text: "## :notebook: Release notes"
- type: section
text:
type: mrkdwn
text: Blah
- type: divider
- type: section
text:
type: mrkdwn
text: "** :computer: Release URL**"
- type: section
text:
type: mrkdwn
text: http://my_url.com
And this is what it ends up looking like:
I have also tried with a payload file:
GHA
- name: Announce Release
if: github.event_name == 'push' && github.ref == 'refs/heads/slack-releases3'
uses: slackapi/slack-github-action@v2.1.0
with:
payload-file-path: .github/workflows/payload.json
webhook: ${{ secrets.MY_SECRET }}
webhook-type: incoming-webhook
errors: true
JSON
{
"channel": "${{ env.SLACK_CHANNEL_ID }}",
"text": "Messages met made meetings meet",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "# Slack notifications sound following the most recent commit pushed"
}
}
]
}
Result
I would expect to be able to use bold and
HEADER
and other markdown fun in a block called mrkdwn.
Am I doing something wrong?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the inline YAML example and .github/workflows/payload.json, then read the linked Slack Block Kit mrkdwn reference. Reproduce the incoming-webhook request with both payload forms and trace how the action handles the blocks; done means the expected formatting behavior is confirmed and covered by an appropriate test or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- api, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100