feat(markdown-to-slack-mrkdwn): add action#1971
Open
domasx2 wants to merge 2 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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 readsINPUT_MARKDOWN, runs it throughslackifyMarkdown, and writes the result to thetextoutput via aGITHUB_OUTPUTheredoc. - Test corpus port (49 cases) from upstream
slackify-markdownplus null/undefined handling, executed withbun 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.
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New composite action that converts CommonMark markdown to Slack
mrkdwn(the syntax insideblocks[].textof achat.postMessagepayload). Wrapsslackify-markdown, so callers can do this conversion without taking a third-party action dependency.Bun-based, following the
dependabot-auto-triagepattern. The 49-case upstreamslackify-markdowntest 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.