Skip to content

ci: pass NO_COLOR=1 to semgrep help docker runs#2594

Closed
leifdreizler wants to merge 3 commits into
mainfrom
fix-help-workflow-no-color
Closed

ci: pass NO_COLOR=1 to semgrep help docker runs#2594
leifdreizler wants to merge 3 commits into
mainfrom
fix-help-workflow-no-color

Conversation

@leifdreizler
Copy link
Copy Markdown
Contributor

@leifdreizler leifdreizler commented Apr 29, 2026

Summary

  • The semgrep 1.161.0 image emits ANSI color escape codes even when stdout is piped, so the auto-generated help PR ends up full of literal escape sequences (e.g. ^[[4mUsage^[[24m, ^[[36msemgrep^[[39m) instead of clean help text.
  • This causes the update-help-command workflow to produce a non-empty diff every run for the same Semgrep version, which then opens PRs (and recently failed mid-flight in run 25121821139 and run 25121993218).
  • Setting NO_COLOR=1 on the three docker run invocations suppresses color output and restores clean diffs, so reruns for an already-documented version will hit the git diff --quiet no-op branch.

Test plan

  • Manually trigger the Update semgrep help command workflow after merge and confirm it exits via "No changes made, exiting." for the current latest Semgrep version (1.161.0, already documented in Update help command output for Semgrep 1.161.0 #2583).
  • On the next real Semgrep release, confirm the auto-generated PR contains plain text without ANSI escape codes.

🤖 Generated with Claude Code

The semgrep 1.161.0 image emits ANSI color escape codes even when stdout
is piped, which causes the auto-generated help PR to be filled with
literal escape sequences (e.g. `^[[4mUsage^[[24m`) instead of clean text.
Setting NO_COLOR=1 on the docker invocation suppresses color output and
restores clean diffs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 29, 2026

Deploy Preview for semgrep-docs-prod ready!

Name Link
🔨 Latest commit 23d4e6f
🔍 Latest deploy log https://app.netlify.com/projects/semgrep-docs-prod/deploys/69f23d1500efa500081274ef
😎 Deploy Preview https://deploy-preview-2594--semgrep-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

leifdreizler and others added 2 commits April 29, 2026 10:12
semgrep's NO_COLOR support (semgrep/semgrep#4742) only covers findings
output, not the Click/rich-click `--help` formatter. Try TERM=dumb,
which rich-click's terminal detection may respect, before falling back
to ANSI stripping.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NO_COLOR and TERM=dumb are both ignored by the Click/rich-click help
formatter that semgrep uses (semgrep's NO_COLOR support only covers
findings output via with_color()). Pipe the output through sed to strip
CSI escape sequences instead — this works regardless of how semgrep
chooses to format its help text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@leifdreizler leifdreizler deleted the fix-help-workflow-no-color branch April 29, 2026 17:17
@leifdreizler leifdreizler restored the fix-help-workflow-no-color branch April 29, 2026 17:18
@khorne3 khorne3 deleted the fix-help-workflow-no-color branch April 29, 2026 17:34
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