1.1 KiB
1.1 KiB
PR Edit Shortcut
This change adds a pr +edit verb, bringing pull requests in line with issue, label, release, milestone, and webhook, which already expose an edit/update command.
Commands
- Add
pr +editforPUT /api/{owner}/{repo}/pulls/{index}.json.
Behavior
pr +editfirst GETs the current PR (the same/pulls/{index}path used bypr +view), then merges the requested changes onto its current values before the PUT. The update endpoint requirestitle,body,head,base,issue_tag_ids, andreceivers_logintogether, so unspecified flags fall back to the existing values to avoid clobbering them.- Flags:
--title,--body,--base,--head, and--tag-ids(comma-separated). At least one is required. --tag-idsreplaces the tag set when given; otherwise the PR's current tag IDs are preserved.- PR detail fields are read defensively across the top-level,
pull_request, andissuescopes, matching how the health checks parse the same endpoint.
Verification
- Unit tests cover field preservation, tag-id override, the nested
pull_requestresponse shape, the missing-field guard, and the HTTP error path.