Skip to content

fix: strip ANSI escape codes from PR comment output#78

Open
k22036 wants to merge 1 commit intomillionco:mainfrom
k22036:fix/action-utf8-locale
Open

fix: strip ANSI escape codes from PR comment output#78
k22036 wants to merge 1 commit intomillionco:mainfrom
k22036:fix/action-utf8-locale

Conversation

@k22036
Copy link

@k22036 k22036 commented Feb 23, 2026

Problem

When react-doctor output is posted as a GitHub PR comment, ANSI color codes (e.g. \x1b[32m) appear as garbled text because GitHub Markdown does not render ANSI escape sequences.

Solution

Pipe the raw output through sed to strip all ANSI escape sequences before writing to the file used for the PR comment. The terminal output in the Actions log remains unaffected (colors are preserved via the raw file).

Changes

  • action.yml: Save raw output to a temporary file, then produce a clean copy with ANSI codes stripped for use in the PR comment body.

・before
スクリーンショット 2026-02-23 14 02 29

・after
スクリーンショット 2026-02-23 14 03 33

@vercel
Copy link

vercel bot commented Feb 23, 2026

@k22036 is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant