GitHub CLI 2.105.0 adds commands for waiting on pull-request events instead of repeatedly polling in a loop. The feature also requires access to GitHub Event Streams, which is in preview. Upgrading the CLI is therefore necessary for the described commands but is not by itself proof that your account can use the service.
Understand what polling was doing
A polling loop repeatedly asks whether state changed, even when nothing happened. That can waste requests and complicate retry logic. An event stream waits for a relevant signal instead. It changes how a workflow wakes up, not the underlying rules for whether the workflow may act.
This is especially useful for an agent waiting for a review or check completion. But a listener must still have a lifetime, error handling and a way to reconcile current state. Replacing a loop with a stream does not eliminate operational design.
Check the two availability gates
First inspect the installed GitHub CLI version. Then check access to the Event Streams preview. The November 18 announcement names both requirements. A command missing from an old binary and a command denied by preview eligibility are different problems.
Use the current command help for event selection and output fields. Do not invent event names from a webhook example if the CLI uses a different supported vocabulary. The simple invocation below illustrates the announced entry point with a placeholder URL.
gh --version
gh event listen --help
gh event listen https://github.com/OWNER/REPOSITORY/pull/123An event wakes the workflow; current state makes the decision
A conceptual automation pattern, not a guarantee of event delivery or permission to merge.
Waiting
- Subscription
Listen for documented events with a bounded lifetime.
- Event arrives
Treat it as a signal that relevant state may have changed.
Acting
- Refetch PR state
Check the current head, reviews and required checks.
- Normal action
Proceed only under existing permissions and branch rules.
An old review event is not approval for a newer commit.
Bound the listener and parse structured output
GitHub describes options for a count, following the stream, a timeout and structured output selection. Choose a bounded duration for a one-time task. A process that waits forever is not automatically a reliable automation; it can retain resources and make completion unclear.
Parse the documented JSON rather than scraping terminal prose. Keep authentication in the CLI's supported credential flow. Do not place a token directly in a public command, workflow file or article to make the example easier to copy.
Scroll the table horizontally to see all columns.
| Concern | Design choice | Failure to prevent |
|---|---|---|
| No event arrives | Explicit timeout and current-state check | Infinite waiting |
| Listener reconnects | Reconcile state and tolerate duplicates | Duplicate actions |
| New commit arrives | Compare current head before acting | Acting on stale review evidence |
| Check completes | Inspect the required check result | Treating completion as success |
| Preview unavailable | Use a supported bounded fallback | Repeated failing command loops |
Preserve branch protections
Do not use administrator bypass to make an event-driven workflow succeed. Required checks and approvals remain required. If an automation may merge a narrow verified change, constrain its scope and expected head and refuse unrelated work or unresolved checks.
Keep permissions minimal. A listener that only reports status does not need broad repository-write access. Separate observation from mutation so a failure in event parsing cannot accidentally become a permission to modify code.
Verify the lifecycle, not only the happy event
Test timeout, cancellation, duplicate notification and stale-head behaviour with a disposable repository or mock event layer. Confirm that subscriptions and processes are cleaned up through the documented controls. Keep logs free of credentials and private event payloads.
The benefit is a quieter, more direct waiting mechanism. The safe design still checks current truth before acting. That distinction applies to many systems: an event tells you to look; the authoritative state tells you what is now allowed.
Frequently asked questions
Which CLI version does the announcement require? GitHub names gh 2.105.0 or later for the new event commands. Check the installed version and current manual because preview commands can change.
Does upgrading gh automatically grant Event Streams access? No. The announcement says the commands require Event Streams preview access and points to a waitlist. Verify account eligibility separately from the binary version.
Can an event listener merge a PR just because a review arrives? It should not infer merge readiness from an event alone. Refetch the current PR head, reviews and required checks, then follow normal permissions and branch protections.
Sources
Technical references checked .



