Skip to content

Commit 0dc877a

Browse files
adinauerclaude
andcommitted
fix: Use --body-file to avoid shell quoting issues in PR body edits
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a775939 commit 0dc877a

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.claude/skills/create-java-pr/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ git push
171171
If no changelog entry is needed, add `#skip-changelog` to the PR description to disable the changelog CI check:
172172

173173
```bash
174-
gh pr edit <PR_NUMBER> --body "$(gh pr view <PR_NUMBER> --json body --jq '.body')
175-
176-
#skip-changelog"
174+
gh pr view <PR_NUMBER> --json body --jq '.body' > /tmp/pr-body.md
175+
printf '\n#skip-changelog\n' >> /tmp/pr-body.md
176+
gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md
177177
```

.cursor/rules/pr.mdc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,17 +213,19 @@ Format:
213213

214214
No status column — GitHub already shows that. The `---` separates the stack list from the rest of the PR description.
215215

216-
To update the PR description:
216+
To update the PR description, use `--body-file` to avoid shell quoting issues with special characters in the body:
217217

218218
```bash
219-
# Get current PR description
220-
gh pr view <PR_NUMBER> --json body --jq '.body'
219+
# Get current PR description into a temp file
220+
gh pr view <PR_NUMBER> --json body --jq '.body' > /tmp/pr-body.md
221221

222-
# Update the description (prepend or replace the stack list section)
223-
gh pr edit <PR_NUMBER> --body "<updated body>"
224-
```
222+
# Edit /tmp/pr-body.md to prepend or replace the stack list section
223+
# (replace everything from "## PR Stack" up to and including the "---" separator,
224+
# or prepend before the existing description if no stack list exists yet)
225225

226-
When updating, replace everything from `## PR Stack` up to and including the `---` separator. If no stack list exists yet, prepend it before the existing description.
226+
# Update the description
227+
gh pr edit <PR_NUMBER> --body-file /tmp/pr-body.md
228+
```
227229

228230
### Merging Stacked PRs (done by the user, not the agent)
229231

0 commit comments

Comments
 (0)