marquetools/Strip ANSI & Unicode Threats

Protects your repo from known ANSI threats and unicode homograph threats. Removes ANSI pollution from Issue and PR comments.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jun 15, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: marquetools/strip-ansi-action@7699bd9f8264d6c5a8d9cae15750e5e673fd2dd6 # v1.0.6

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
filesNewline- or space-separated list of file paths to scan. Typically populated from the output of a changed-files step or a similar action. Leave empty when only scanning PR or Issue comments. no""
on-threatAction to take when an echoback attack vector is detected. Accepted values: fail (default), strip, warn. fail — mark files, emit ::error annotations, and exit non-zero after all files are processed. strip — remove threats from output and continue; sets the threat-detected output to true. warn — emit ::warning annotations and continue; sets the threat-detected output to true. nofail
unicode-mapReserved for a future release of distill-strip-ansi that will support Unicode normalization map selection. Has no effect with the current version. no""
no-unicode-mapReserved for a future release of distill-strip-ansi that will support Unicode normalization map selection. Has no effect with the current version. no""
presetANSI filter preset controlling which escape sequences survive. Accepted values: dumb, color, sanitize (default), tmux, xterm, full. dumb — strip everything. color — keep SGR colors/styles only. sanitize — safe default; keeps safe OSC (titles, links), strips echoback vectors. tmux — all CSI and Fe sequences. xterm — all OSC sequences. full — pass everything through. nosanitize
versionVersion of distill-strip-ansi to install (must match a published crates.io release).no0.6.1
clean-pr-commentsWhen true, fetches all comments on the pull request that triggered this workflow (both discussion comments and review comments) and scans them for ANSI/Unicode threats. Requires a token with pull-requests:read (and pull-requests:write when on-threat=strip). Only meaningful when the workflow is triggered by a pull_request or pull_request_review_comment event. nofalse
clean-issue-commentsWhen true, fetches all comments on the issue that triggered this workflow and scans them for ANSI/Unicode threats. Requires a token with issues:read (and issues:write when on-threat=strip). Only meaningful when the workflow is triggered by an issues or issue_comment event. nofalse
github-tokenGitHub token used to read and (when on-threat=strip) update PR/Issue comments. Defaults to the built-in github.token. Only used when clean-pr-comments or clean-issue-comments is true. no""
namedescription
resultsJSON array of per-file scan results. Schema: [{"file":"<path>","status":"clean|stripped|threat","output":"<stripped content>"}] The output field is empty for files with detected threats unless on-threat=strip. Note: large files may be truncated in this field; check runner logs for full output.
threat-detected'true' if any scanned file contained an echoback attack vector, 'false' otherwise.
files-with-threatsNewline-separated list of file paths that contained detected threats.
comment-resultsJSON array of per-comment scan results (populated when clean-pr-comments or clean-issue-comments is true). Schema: [{"id":"<id>","type":"pr_comment|review_comment|issue_comment","url":"<html_url>","status":"clean|stripped|threat","output":"<stripped content>"}]
comment-threat-detected'true' if any scanned comment contained an echoback attack vector, 'false' otherwise. Only set when clean-pr-comments or clean-issue-comments is true.
comments-with-threatsNewline-separated list of comment HTML URLs that contained detected threats. Only set when clean-pr-comments or clean-issue-comments is true.