Markdown blocks are not sending with incoming webhooks
还没有人认领这个 Issue。
评估
调研方向
先从内联 YAML 示例和 .github/workflows/payload.json 开始,然后阅读链接的 Slack Block Kit mrkdwn 参考文档。使用两种 payload 形式重现 incoming-webhook 请求,并跟踪 action 如何处理 blocks;当预期的格式行为得到确认,并由适当的测试或已记录的限制加以覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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/[email protected]
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/[email protected]
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?
- 主要语言
- JavaScript
- 星标
- 1.4k
- 派生
- 200
- 平均合并
- 1 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slackapi/slack-github-action 的其他 Issue
-
docs
难度 1/5 1 小时以内 新手友好度 82/100
slackapi/slack-github-action#667 ·
-
discussion security semver:major
难度 2/5 1-3 小时 新手友好度 72/100
slackapi/slack-github-action#621 · 1 条评论 · 1 个 reaction ·
-
bug: Unexpected token 'o', "ok" is not valid JSON可能重新可做 @zimeg 于 59 天前认领,目前没有进行中的 PR。 未关闭dependencies question
slackapi/slack-github-action#671 · 2 条评论 · 已指派 1 人 ·
-
needs info question
难度 3/5 1-2 天 新手友好度 55/100
slackapi/slack-github-action#654 · 7 条评论 · 5 个 reaction ·
-
question
难度 5/5 一周以上 新手友好度 20/100
slackapi/slack-github-action#520 · 1 条评论 ·
查看 slackapi/slack-github-action 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
jspreadsheet/ce#1809 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
githubnext/gh-aw-workshop#4458 ·
维护者通常 1 天内回复
-
Add: Cartoonito未关闭check:failed feeds:add
难度 2/5 1-3 小时 新手友好度 63/100
iptv-org/database#37390 · 1 条评论 ·
维护者通常 9 天内回复
-
bug: directory index route root priority is overwritten when wildcard is false可能已有人在做 @TalhaHunter101 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
fastify/fastify-static#617 ·
-
bug confirmed css v6
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复