Skip to content

Commit 4a51981

Browse files
cliffhallclaude
andcommitted
docs(release): edit the Version Packages body only after a successful read
A failed gh pr view must not let gh pr edit replace the generated release notes with the Part of prefix alone (Copilot, #5221). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent c9aa5b8 commit 4a51981

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎.claude/skills/release/SKILL.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ Then, on the PR:
222222
regenerates the body and drops the line.
223223

224224
```sh
225-
BODY=$(mktemp)
226-
{ echo "Part of #$N"; echo
227-
gh pr view "$PR" --repo modelcontextprotocol/servers --json body --jq .body
228-
} > "$BODY"
229-
gh pr edit "$PR" --repo modelcontextprotocol/servers --body-file "$BODY"
225+
# Read the body first, and edit only on a successful, non-empty read: a
226+
# failed read must never replace the generated release notes with the
227+
# prefix alone.
228+
OLD=$(gh pr view "$PR" --repo modelcontextprotocol/servers --json body --jq .body) \
229+
&& [ -n "$OLD" ] \
230+
&& printf 'Part of #%s\n\n%s\n' "$N" "$OLD" \
231+
| gh pr edit "$PR" --repo modelcontextprotocol/servers --body-file - \
232+
|| echo "body read or edit FAILED — PR body left as it was" >&2
230233
```
231234

232235
5. A maintainer merges it, **first checking the line is still the body's

0 commit comments

Comments
 (0)