Skip to content

feat(markdown-to-slack-mrkdwn): add action#1971

Open
domasx2 wants to merge 2 commits into
mainfrom
feat-markdown-to-slack-mrkdwn
Open

feat(markdown-to-slack-mrkdwn): add action#1971
domasx2 wants to merge 2 commits into
mainfrom
feat-markdown-to-slack-mrkdwn

Conversation

@domasx2
Copy link
Copy Markdown

@domasx2 domasx2 commented May 28, 2026

Summary

New composite action that converts CommonMark markdown to Slack mrkdwn (the syntax inside blocks[].text of a chat.postMessage payload). Wraps slackify-markdown, so callers can do this conversion without taking a third-party action dependency.

Bun-based, following the dependabot-auto-triage pattern. The 49-case upstream slackify-markdown test corpus runs in CI to lock in parity with the library.

Why

Grafana repos post release notifications to Slack and need a markdown → Slack mrkdwn conversion step. We were using 3d party action

PR description authored by Claude on Domas's behalf.

Wraps slackify-markdown so callers can convert CommonMark to Slack mrkdwn
(the syntax accepted inside blocks[].text of a chat.postMessage payload)
without taking a third-party action dependency. Bun-based composite action
following the same pattern as actions/dependabot-auto-triage.

The 49-case upstream slackify-markdown test corpus runs in CI to lock in
behavior parity with the library.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@domasx2 domasx2 requested a review from a team as a code owner May 28, 2026 11:14
@domasx2 domasx2 requested a review from Copilot May 28, 2026 11:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Bun-based composite action markdown-to-slack-mrkdwn that wraps the slackify-markdown npm library to convert CommonMark to Slack mrkdwn, so Grafana repos can stop depending on a third-party action for Slack release-notification formatting. Follows the existing dependabot-auto-triage pattern (Bun runtime, composite action, workspace member, release-please-managed).

Changes:

  • New action under actions/markdown-to-slack-mrkdwn/ (action.yml, src/index.ts, README, package.json, .bun-version) that reads INPUT_MARKDOWN, runs it through slackifyMarkdown, and writes the result to the text output via a GITHUB_OUTPUT heredoc.
  • Test corpus port (49 cases) from upstream slackify-markdown plus null/undefined handling, executed with bun test.
  • Workspace, root lockfile, and release-please manifest/config wired up for the new package.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
actions/markdown-to-slack-mrkdwn/action.yml Composite action steps: setup-bun, install, run TS, emit text output via heredoc.
actions/markdown-to-slack-mrkdwn/src/index.ts Thin wrapper exposing transform() and writing converted markdown to stdout.
actions/markdown-to-slack-mrkdwn/src/index.test.ts Parity tests against upstream slackify-markdown corpus + nullish input.
actions/markdown-to-slack-mrkdwn/package.json Workspace package metadata, scripts, slackify-markdown dep.
actions/markdown-to-slack-mrkdwn/README.md Usage docs, inputs/outputs, embedding tips.
actions/markdown-to-slack-mrkdwn/.bun-version Pins Bun 1.3.13 for setup-bun.
package.json Adds new action to Bun workspaces.
bun.lock Adds slackify-markdown and its mdast/micromark transitive deps.
release-please-config.json Registers the new action for release-please.
.release-please-manifest.json Initial 0.1.0 entry for the new package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread actions/markdown-to-slack-mrkdwn/action.yml
Comment thread actions/markdown-to-slack-mrkdwn/action.yml
…delimiter

Addresses two findings from PR review:

- Ship actions/markdown-to-slack-mrkdwn/bun.lock alongside package.json so
  the action follows the same pattern as actions/dependabot-auto-triage and
  actions/get-latest-workflow-artifact. Avoids subtle resolution differences
  between local dev and the action runtime.
- Use a random GITHUB_OUTPUT heredoc delimiter (SLACK_MD_EOF_$(openssl rand
  -hex 16)) so user-controlled markdown content cannot truncate the output
  by including a line equal to a fixed sentinel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants