Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Markdown blocks are not sending with incoming webhooks

未关闭
#440 6 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
github-actions
领域
api, ci-cd

调研方向

先从内联 YAML 示例和 .github/workflows/payload.json 开始,然后阅读链接的 Slack Block Kit mrkdwn 参考文档。使用两种 payload 形式重现 incoming-webhook 请求,并跟踪 action 如何处理 blocks;当预期的格式行为得到确认,并由适当的测试或已记录的限制加以覆盖时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

auto-triage-skip bug question server-side 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:
Image

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
Image

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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

slackapi/slack-github-action 的其他 Issue

查看 slackapi/slack-github-action 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。