GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: print control characters and workflow commands in commit text inert by shenxianpeng · Pull Request #620 · commit-check/commit-check

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Before: when a check failed, the text output printed the offending commit message, branch or tag name exactly as written. Escape sequences in it went straight to the reader's terminal (OSC 52 can write the clipboard, ESC[2K can erase what was printed), and a message body line starting with :: was printed at the start of a line, where a GitHub Actions runner reads it as a workflow command (::error, ::add-mask::).

After: in text output, control characters other than newline and tab are shown as \xNN escapes, a line that starts with :: (after any indentation) gets a backslash in front (\::error ...), and the older ##[command] form is broken up the same way (#\#[). The text is still readable, but it can no longer control the terminal or the runner. --format json output is unchanged; the JSON encoder already escapes it.

Before / after

msg.txt was written with:

$ printf 'Bad subject \033]52;c;ZWNobyBwd25lZA==\007\033[2Khidden\n\n::error file=README.md,line=1::Spoofed annotation\n::add-mask::[email protected]\n' > msg.txt

Before (main)

$ cchk msg.txt -m --no-banner | cat -v
CC001 message check failed ==> Bad subject ^[]52;c;ZWNobyBwd25lZA==^G^[[2Khidden

::error file=README.md,line=1::Spoofed annotation
::add-mask::[email protected]
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, style, refactor, test, chore, ci
Docs: https://commit-check.com/rules/#cc001

$ cchk msg.txt -m --compact | cat -v
[FAIL] CC001 message: Bad subject ^[]52;c;ZWNobyBwd25lZA==^G^[[2Khidden

After (this branch)

$ cchk msg.txt -m --no-banner | cat -v
CC001 message check failed ==> Bad subject \x1b]52;c;ZWNobyBwd25lZA==\x07\x1b[2Khidden

\::error file=README.md,line=1::Spoofed annotation
\::add-mask::[email protected]
The commit message should follow Conventional Commits. See https://www.conventionalcommits.org
Suggest: Use <type>(<scope>): <description>, where <type> is one of: feat, fix, docs, style, refactor, test, chore, ci
Docs: https://commit-check.com/rules/#cc001

$ cchk msg.txt -m --compact | cat -v
[FAIL] CC001 message: Bad subject \x1b]52;c;ZWNobyBwd25lZA==\x07\x1b[2Khidden

cchk msg.txt -m --format json prints byte-identical output on both.

How

A new printable() helper in commit_check/util.py escapes C0/C1 control characters and DEL (keeping \n and \t), puts a backslash before the :: of any line whose first non-blank characters are ::, and turns ##[ into #\#[. Indenting alone would not be enough: the Actions runner calls TrimStart() before looking for ::, and it finds ##[ anywhere in a line. _print_failure applies it to the value (full and --compact output), the error and the suggestion, since a suggestion can quote a fixed value built from the commit text. Every text-mode failure goes through _print_failure. Tests cover the helper case by case and both output paths.

Text output visible to users changes, so commit-check.com may need an update after release.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shenxianpeng
fix: print control characters and workflow commands in commit text inert
4a9a23c
@shenxianpeng
shenxianpeng requested a review from a team as a code owner October 15, 2026 19:44
@shenxianpeng shenxianpeng self-assigned this Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 92c57c2b-b452-4d23-90a2-6e97600e0c74
📥 Commits

Reviewing files that changed from the base of the PR and between 4791607 and d0484fd.

📒 Files selected for processing: 2
  • commit_check/util.py
  • tests/util_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the bug Something isn't working label Oct 15, 2026
@codecov

codecov Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4791607) to head (d0484fd).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #620   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         2386      2394    +8     
=========================================
+ Hits          2386      2394    +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Oct 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 133 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

  • test_subject_length_validator_max_too_long
  • test_forbid_policy_multiple_tools
  • test_forbid_policy_rejects_ai_commit
  • test_subject_length_validator_min_too_short
  • test_commit_message_validator_custom_pattern_github_issue
  • test_commit_message_validator_custom_pattern_jira
  • test_validation_engine_validate_all_fail
  • test_inflected_first_words_are_rejected[fix: updated the docs]
  • test_body_validator_no_body
  • test_inherit_from_key_is_removed_from_result
  • …and 123 more

✅ 645 untouched benchmarks
⏩ 126 skipped benchmarks1


Comparing fix/escape-control-chars-in-text-output (d0484fd) with main (4791607)

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng force-pushed the fix/escape-control-chars-in-text-output branch from 084c48d to 4a9a23c Compare October 18, 2026 06:02
shenxianpeng added 2 commits October 18, 2026 06:03
@shenxianpeng
Merge remote-tracking branch 'origin/main' into fix/escape-control-ch…
431dd8d
…ars-in-text-output
@shenxianpeng
perf: return text with nothing to escape unchanged
d0484fd
printable() ran its regex substitution and split every line of every
failure message, though almost none carry a control character, :: or
##[. Check for those first with str methods and return the text as is.
The output is unchanged.
@sonarqubecloud

sonarqubecloud Bot commented Oct 18, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng merged commit 1db9251 into main Oct 18, 2026
32 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@shenxianpeng
shenxianpeng deleted the fix/escape-control-chars-in-text-output branch October 18, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@shenxianpeng shenxianpeng

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@shenxianpeng
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.