Skip to content

fix: use printf %b to decode encoded newlines in smoke-ci comment-memory (#28937)#28953

Merged
pelikhan merged 1 commit intomainfrom
copilot/fix-encoded-new-line
Apr 28, 2026
Merged

fix: use printf %b to decode encoded newlines in smoke-ci comment-memory (#28937)#28953
pelikhan merged 1 commit intomainfrom
copilot/fix-encoded-new-line

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 28, 2026

Summary

Fixes the encoded \n appearing literally in the comment-memory text, as seen in #28937 comment:

CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing

Root cause

In smoke-ci.md, the HAIKU variable is assigned inside a bash -lc '...' call:

HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"

Within the single-quoted string passed to bash -lc, the \n in the double-quoted assignment is never interpreted as a newline — it remains a literal backslash-n. The subsequent printf "%s\n" "$HAIKU" writes those literal characters to the comment-memory file, which is then posted as-is to GitHub.

Fix

Change printf "%s\n"printf "%b\n" (both the initial-write and the append path). The %b format specifier causes printf to interpret backslash escape sequences in its arguments, so \n in $HAIKU is decoded to an actual newline character before being written to the file.

@pelikhan pelikhan marked this pull request as ready for review April 28, 2026 15:08
Copilot AI review requested due to automatic review settings April 28, 2026 15:08
@pelikhan pelikhan merged commit d698535 into main Apr 28, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/fix-encoded-new-line branch April 28, 2026 15:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes smoke-ci’s comment-memory content so \n sequences in the haiku are written as real newlines instead of appearing literally in posted comments.

Changes:

  • Updated the smoke-ci workflow template to use printf "%b\n" when writing/appending the haiku to comment-memory files.
  • Regenerated the compiled workflow lock file to reflect the template change.
Show a summary per file
File Description
.github/workflows/smoke-ci.md Switches haiku writes/appends to printf %b so \n escapes decode into actual newlines.
.github/workflows/smoke-ci.lock.yml Compiled output updated to include the printf %b change in the generated engine command.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request Apr 28, 2026
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.

3 participants