AI Moves
GitHub CLI Pull Request Events: Listen First, Then Check State
GitHub CLI can wait for pull request events. Check the current review and CI status when you connect, when an event arrives, or when the wait expires.

Image: AI-generated editorial illustration.
If an agent is waiting for a human review, it may keep asking GitHub the same question every minute: has the pull request changed yet? GitHub CLI now has a preview command that can wait for a specific pull request event instead. gh event listen can watch for a review, state change, new head commit, merge-conflict signal or completed check suite, then print each event as JSON. GitHub announced the command on November 18 for gh 2.105.0 and later. (GitHub Changelog, Event Streams guide)
Before trying it, check the preview gates: Event Streams access is waitlist-based, the current service is on GitHub.com rather than GHE.com, and your user or app installation needs read access to the pull request. Both Event Streams and gh event are previews that may change. (Event Streams guide)
In one terminal, a code-review agent can wait up to 30 minutes for a submitted review:
gh event listen \
--resource https://github.com/OWNER/REPO/pull/42 \
--event com.github.pull_request.review.submitted.v1 \
--timeout 30m
GitHub does not replay changes that occurred before the stream opened. Once the listener prints “Listening for events” to stderr, use a second terminal to reconcile the pull request:
gh pr view 42 --repo OWNER/REPO --json state,reviewDecision,latestReviews,headRefOid
This ordering catches a review that landed just before the stream attached. If the review you needed already landed, stop waiting. Later, the event is a wake-up signal, not the review decision itself: fetch its API URL or inspect the pull request again to see whether the reviewer approved, requested changes or commented. A hypothetical agent can then stop polling on a timer while keeping its action tied to the current PR state. (Event Streams guide, gh event listen manual, gh pr view manual)
CI is a separate case. GitHub emits one event for each completed check suite, and one pull request can have several suites. A green event tells you about one suite. Run gh pr checks 42 --repo OWNER/REPO to inspect current CI status. GitHub says the stream excludes commit statuses created through the REST API. If a required check uses one, fetch that status separately. (Event Streams guide, gh pr checks manual)
When --timeout expires, gh event listen exits with status 8. That means the wait ended without a matching event; it does not mean a review was rejected or checks failed. Refresh the PR/check view and either start another bounded wait or hand the case to a person. If the preview is unavailable, periodic checks remain a fallback. (gh event listen manual, gh pr checks manual)
Sources
- Wait for pull request events with GitHub CLIRetrieved
- Using GitHub Event StreamsRetrieved
- gh event listenRetrieved
- gh pr viewRetrieved
- gh pr checksRetrieved
Related articles

Anthropic closes IPO at $83 a share and reports $91.6 billion in proceeds
Anthropic closed its IPO at $83 a share. See what the company raised through the public offering and how the separate $26 billion placement fits in.
AWS Quick connects Seller Central data to an AI workflow
AWS Quick's beta Seller Central plugin connects live sales and inventory data. Check its US store limit, permissions and cost-of-goods gap first.
Azure Catalyst expands Azure Migrate into modernization
Azure Catalyst connects discovery and migration planning with agent-assisted modernization. Existing Azure Migrate projects continue to work.