Skip to content

Commit aac6e2e

Browse files
ryan-williamsclaude
andcommitted
Fix push command issues with draft comments
- Fix comment body being posted as temp file path instead of content - Use `--input <file>` with `-f body=@-` to read from stdin properly - Fix crash when `new*.md` has local modifications - Use `git rm -f` to force removal even with uncommitted changes - This allows iterating on draft comments without committing Fixes issue where `gh api -f 'body=@{temp_file}'` was being interpreted literally as the string "@/var/folders/..." instead of reading the file contents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fa56ea2 commit aac6e2e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ghpr/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,8 @@ def push(
11671167
'gh', 'api',
11681168
'-X', 'POST',
11691169
f'repos/{owner}/{repo}/issues/{number}/comments',
1170-
'-f', f'body=@{temp_file}',
1170+
'--input', temp_file,
1171+
'-f', 'body=@-',
11711172
log=False
11721173
)
11731174
comment_id = str(result['id'])
@@ -1276,7 +1277,8 @@ def push(
12761277
if new_comment_renames and not dry_run:
12771278
# Remove old draft files and add new comment files
12781279
for old_name, new_name in new_comment_renames:
1279-
proc.run('git', 'rm', old_name, log=False)
1280+
# Use -f to force removal even if there are local modifications
1281+
proc.run('git', 'rm', '-f', old_name, log=False)
12801282
proc.run('git', 'add', new_name, log=False)
12811283

12821284
# Create commit message

0 commit comments

Comments
 (0)