Skip to content

fix(ce-commit-push-pr): append PR body so zsh noclobber can't blank it#1008

Merged
tmchow merged 1 commit into
mainfrom
tmchow/investigate-issue-1003
Jun 26, 2026
Merged

fix(ce-commit-push-pr): append PR body so zsh noclobber can't blank it#1008
tmchow merged 1 commit into
mainfrom
tmchow/investigate-issue-1003

Conversation

@tmchow

@tmchow tmchow commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Under zsh with noclobber set, this skill's recommended snippet silently published an empty PR bodygh still exited 0 and returned a valid URL, so the failure was invisible unless you re-read the PR. mktemp creates the temp file empty, then cat > redirected onto the now-existing file; noclobber refuses > to an existing file, discarding the heredoc. Switching to cat >> (append) writes the body regardless of clobber settings — equivalent for the already-empty file, and identical in bash and zsh.

This is the exact silent-empty-body failure the section's own warning (line 119) exists to prevent.

Fixes #1003


Compound Engineering
Claude Code

mktemp creates the temp file empty, then `cat >` redirected onto the
existing file. Under zsh `setopt noclobber`, `>` to an existing file is
refused, the heredoc is discarded, and gh publishes an empty PR body
while still exiting 0. Switch to `cat >>` (append), which is equivalent
for the already-empty file and is independent of clobber settings.

Fixes #1003
@tmchow tmchow merged commit 240b69e into main Jun 26, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 26, 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.

ce-commit-push-pr: recommended mktemp + cat > snippet silently writes empty PR body under zsh noclobber

1 participant