[PR #23] [MERGED] fix(bump): preserve trailing newline in bumped caller files #32

Closed
opened 2026-10-26 22:35:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/github-workflows/pull/23
Author: @mattmillerai
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/7/2026
Merged by: @mattmillerai

Base: main ← Head: matt/fix-bump-trailing-newline


📝 Commits (1)

  • 07c116d fix(bump): preserve trailing newline in bumped caller files

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 .github/workflows/bump-cursor-review-callers.yml (+6 -2)

📄 Description

ELI-5

When this repo updates the shared review workflow, a bot opens a "bump" PR in every consumer repo to point at the new version. That bot was accidentally chopping the final newline off the file it edited, and the consumer repos' code formatters insist every file end with a newline — so the bump PR's format check failed every time. This makes the bot put the newline back.

Root cause

bump-cursor-review-callers.yml builds the new file contents through two command substitutions — OLD_CONTENT=$(… | base64 -d) and NEW_CONTENT=$(sed … ) — and shell $(...) strips all trailing newlines. It then re-encodes with printf '%s', which adds none back. Result: every bumped caller file is committed with no EOF newline.

Receiver repos run oxfmt --check (and others run prettier); both require a trailing newline, so the auto-opened bump PR fails format:check on the very file it just edited.

Fix

One character: printf '%s' → printf '%s\n'. Since the $(...) capture already collapsed any trailing newlines to zero, this restores exactly one — the formatter-clean state.

Scope note

This fixes the newline-stripping class of failure (the one hitting oxfmt's EOF rule). A caller file that is non-conformant for an unrelated reason — e.g. a repo whose formatter prefers double-quoted name: values — still needs a one-time reformat of its own caller file; the bump only rewrites the pinned SHA and never touches those lines. Both currently-open bump PRs have been corrected directly.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/github-workflows/pull/23 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 7/7/2026 **Status:** ✅ Merged **Merged:** 7/7/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `matt/fix-bump-trailing-newline` --- ### 📝 Commits (1) - [`07c116d`](https://github.com/Comfy-Org/github-workflows/commit/07c116dfddc2b3fb8ed4af4f1bd8ae9876f7f3d3) fix(bump): preserve trailing newline in bumped caller files ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/bump-cursor-review-callers.yml` (+6 -2) </details> ### 📄 Description ## ELI-5 When this repo updates the shared review workflow, a bot opens a "bump" PR in every consumer repo to point at the new version. That bot was accidentally chopping the final newline off the file it edited, and the consumer repos' code formatters insist every file end with a newline — so the bump PR's format check failed every time. This makes the bot put the newline back. ## Root cause `bump-cursor-review-callers.yml` builds the new file contents through two command substitutions — `OLD_CONTENT=$(… | base64 -d)` and `NEW_CONTENT=$(sed … )` — and shell `$(...)` strips **all** trailing newlines. It then re-encodes with `printf '%s'`, which adds none back. Result: every bumped caller file is committed with no EOF newline. Receiver repos run `oxfmt --check` (and others run prettier); both require a trailing newline, so the auto-opened bump PR fails `format:check` on the very file it just edited. ## Fix One character: `printf '%s'` → `printf '%s\n'`. Since the `$(...)` capture already collapsed any trailing newlines to zero, this restores exactly one — the formatter-clean state. ## Scope note This fixes the newline-stripping class of failure (the one hitting oxfmt's EOF rule). A caller file that is non-conformant for an unrelated reason — e.g. a repo whose formatter prefers double-quoted `name:` values — still needs a one-time reformat of its own caller file; the bump only rewrites the pinned SHA and never touches those lines. Both currently-open bump PRs have been corrected directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:35:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/github-workflows#32
No description provided.