返回 Skill 列表
extension
分类: 开发与工程无需 API Key

gh-update-pr

在更新GitHub PR标题或正文时使用。解决由于GitHub的Projects Classic弃用导致的gh pr edit GraphQL错误。

person作者: jakexiaohubgithub

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.

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:
    gh api repos/{owner}/{repo}/pulls/{number} -X PATCH -f title="..." -f body="..." --jq '.html_url'
    
  3. To get the current PR number and repo, use:
    gh pr view --json number,url,baseRefName
    
  4. gh pr view and gh pr create still work fine. Only gh pr edit is affected.