# gh pr review: Approve or Request Changes

> gh pr review approves, requests changes, or comments on a pull request from CI. Reference for --approve, --request-changes, --body, and the self-review errors.

Source: https://latchkey.dev/learn/command-reference/gh-pr-review  
Updated: 2026-06-30

gh pr review submits an approval, a request for changes, or a review comment on a pull request.

Bots that auto-approve dependency bumps or block on policy failures use gh pr review to submit a verdict programmatically.

## What it does

gh pr review submits a pull request review with one of three verdicts: approve, request changes, or a plain comment. The verdict and an optional body become a formal review entry on the PR.

## Common usage

```Terminal
gh pr review 123 --approve
gh pr review 123 --request-changes --body "Needs tests"
gh pr review 123 --comment --body "Looks reasonable"
```

## Flags

| Flag | What it does |
| --- | --- |
| -a, --approve | Approve the pull request |
| -r, --request-changes | Request changes (requires --body) |
| -c, --comment | Comment without an explicit verdict (requires --body) |
| -b, --body <text> | Review body text |
| -F, --body-file <file> | Read the body from a file (- for stdin) |
| -R, --repo <owner/repo> | Target a specific repository |

## In CI

Set GH_TOKEN and permissions: { pull-requests: write }. GitHub forbids approving your own PR, so a bot review only counts toward protection when the PR author is a different identity. --request-changes and --comment both require a non-empty --body.

## Common errors in CI

"GraphQL: Can not approve your own pull request" appears when the token identity authored the PR. "GraphQL: Resource not accessible by integration" means the token lacks pull-requests: write or it is a fork run. "pull request review thread must contain a body" means --request-changes or --comment was used without --body.

## Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

```.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### gh pr review: Approve or Request Changes?

Bots that auto-approve dependency bumps or block on policy failures use gh pr review to submit a verdict programmatically.

### What it does?

gh pr review submits a pull request review with one of three verdicts: approve, request changes, or a plain comment. The verdict and an optional body become a formal review entry on the PR.

### In CI?

Set GH_TOKEN and permissions: { pull-requests: write }. GitHub forbids approving your own PR, so a bot review only counts toward protection when the PR author is a different identity. --request-changes and --comment both require a non-empty --body.

### Common errors in CI?

"GraphQL: Can not approve your own pull request" appears when the token identity authored the PR. "GraphQL: Resource not accessible by integration" means the token lacks pull-requests: write or it is a fork run. "pull request review thread must contain a body" means --request-changes or --comment was used without --body.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
