gh-update-pr

Installation
SKILL.md

Update PR via REST API

gh pr edit is broken due to GitHub deprecating Projects Classic (projectCards GraphQL field error). Use the REST API instead. gh pr view and gh pr create still work fine — only gh pr edit is affected.

Rules

  1. Never use gh pr edit to update PR title or body. It will fail with a GraphQL error.
  2. Use gh api with the REST endpoint. Always pipe JSON via jq --arg to avoid shell injection:
    jq -n --arg title "..." --arg body "..." '{title: $title, body: $body}' | \
      gh api repos/{owner}/{repo}/pulls/{number} -X PATCH --input - --jq '.html_url'
    
  3. Get the current PR context before updating:
    gh pr view --json number,url,baseRefName
    
  4. Omit unchanged fields. If only updating the title, do not include body in the JSON payload, and vice versa. Including an unchanged field risks overwriting it with stale content.

Verification procedure

Related skills
Installs
29
First Seen
Feb 10, 2026