# gh pr ready: Mark a Pull Request Ready

> gh pr ready toggles a pull request between draft and ready-for-review. Reference for --undo, the bot-PR caveat, and the integration permission errors in CI.

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

gh pr ready flips a draft pull request to ready for review, or back to draft with --undo.

Automation often opens a draft PR, waits for generated content or checks, then promotes it. gh pr ready is the promote step.

## What it does

gh pr ready marks a draft pull request as ready for review, which triggers required reviewers and review-gated checks. With --undo it converts a ready PR back to draft.

## Common usage

```Terminal
gh pr ready 123
gh pr ready 123 --undo
gh pr ready -R owner/repo 123
```

## Flags

| Flag | What it does |
| --- | --- |
| --undo | Convert the pull request back to a draft |
| -R, --repo <owner/repo> | Target a specific repository |

## In CI

Set GH_TOKEN and add permissions: { pull-requests: write }. Note GITHUB_TOKEN cannot create or convert PRs in a way that triggers other workflows; if you need the ready event to start downstream workflows, use a PAT or a GitHub App token instead of the default token.

## Common errors in CI

"GraphQL: Resource not accessible by integration" means the token lacks pull-requests: write or the action is on a fork without write access. "could not determine base repository" means no PR context; pass the number and -R. Converting an already-ready PR without --undo is a no-op, not an error.

## 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 ready: Mark a Pull Request Ready?

Automation often opens a draft PR, waits for generated content or checks, then promotes it. gh pr ready is the promote step.

### What it does?

gh pr ready marks a draft pull request as ready for review, which triggers required reviewers and review-gated checks. With --undo it converts a ready PR back to draft.

### In CI?

Set GH_TOKEN and add permissions: { pull-requests: write }. Note GITHUB_TOKEN cannot create or convert PRs in a way that triggers other workflows; if you need the ready event to start downstream workflows, use a PAT or a GitHub App token instead of the default token.

### Common errors in CI?

"GraphQL: Resource not accessible by integration" means the token lacks pull-requests: write or the action is on a fork without write access. "could not determine base repository" means no PR context; pass the number and -R. Converting an already-ready PR without --undo is a no-op, not an error.

---

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
