gh event listen for Coding Agents: Wait for PR Reviews and Check Suites Instead of Polling, With a Fallback When Event Streams Is Off
Use gh event listen to make a coding agent wait for a PR review or check suite, re-read state after attach, handle exit 8, clean up, and fall back to polling.
Your coding agent just opened a pull request and asked for a review. Next it does what most agents do: run gh pr view, sleep thirty seconds, run it again, and read the same unchanged output into its context window. The gh event listen command in GitHub CLI replaces that loop with one blocking call that returns when something actually happens. This tutorial builds a copyable wait-for-pr.sh script and an agent instruction block around it. The agent waits for a submitted review or a finished check suite, re-reads the pull request, acts once, and falls back to bounded polling wherever Event Streams is not available.
This guide is for a developer or platform engineer who points Claude Code, Codex, Copilot CLI or a homegrown script at GitHub.com repositories and wants those agents to stop spending requests while they wait. You need gh 2.105.0 or later, an account enrolled in the Event Streams preview, and a pull request on GitHub.com. jq is optional because gh carries its own --jq flag. Every expected result in the worked example is illustrative: it shows what the documented behavior should produce, not output captured for this article.
One rule organizes everything that follows. The event wakes the agent; a fresh read of the pull request decides what the agent does. The stream is live only, so anything that happened before the listener attached is never replayed. Events are thin, so they say that something changed and point at it rather than describing the pull request. And a pull request usually has several check suites, so one finished suite says nothing about the others. A loop that trusts the event alone will miss reviews, handle some twice, and call a build green while half of it is still running.
What gh event listen gives an agent loop
The news, once: GitHub’s changelog post of November 18, 2026 announced that gh v2.105.0 supports GitHub Event Streams. You run gh event listen with a pull request URL and the events you care about, and it creates the subscription, opens the stream and prints each event as a line of JSON, exiting after the first event by default. The commands are in preview and may change. Everything else in this guide is about using the command well, and that part stays useful whatever the version number becomes.
The implementation pull request, cli/cli #15072, spells out the behavior an agent loop depends on. Creating a subscription is idempotent, so running the same command twice reuses the matching subscription. Events go to stdout as one compact CloudEvent JSON object per line, and status messages go to stderr, so a file that captures stdout holds only events. Each time the stream attaches, the command prints Listening for events. to stderr, followed by a reminder to read the current state now. Network errors, 5xx responses and dropped streams trigger a reconnect with jittered exponential backoff up to 30 seconds, and a stream that sends nothing, not even a heartbeat, for 45 seconds is treated as dead. The stack overview in cli/cli issue #15070 adds the last piece: events are thin, saying what changed and pointing at it with data.api_url.
The flags come from the gh reference manual. The right-hand column is this guide’s recommendation for unattended agents, not documented policy.
| Flag | Documented behavior | Use in an unattended agent loop |
|---|---|---|
--resource |
URL of the pull request to listen to | Always; it lets gh recreate an expired subscription |
--event |
Event type; repeat or separate with commas | Always, with full type names |
--count |
Exit after this many events (default 1) | Rarely; the number of check suites is not known in advance |
--follow |
Keep listening until stopped | No; reserve it for human-watched review rounds |
--timeout |
Exit with status 8 after a duration such as 30s or 10m |
Always; it is the loop’s upper bound |
--jq / --template |
Format each event | Yes; pull out data.api_url or data.conclusion |
--subscription |
Attach to an existing subscription ID | Only when you pre-created one |
The exit-after-one-event default is deliberate. The #15072 description explains that agent harnesses resume an agent when a background command exits, not when it prints, so a listener that keeps running leaves the agent waiting even after the review has landed. --timeout exits with status 8, which reuses the status gh pr checks returns for pending checks, so a script can tell “nothing happened yet” apart from a failure.
Two event types carry this guide: com.github.pull_request.review.submitted.v1 for a submitted review and com.github.pull_request.check_suite.status.changed.v1 for a completed check suite. The changelog also lists pull request state and head changes and merge conflicts as supported events; run gh event listen --help on your build to read their exact names rather than guessing them. Completion for --event suggests known types but accepts any value, and the server rejects unsupported types with a 422, so a typo fails loudly instead of waiting forever.

Prerequisites and a one-minute access check
Run these checks once per machine, and again inside any container or CI runner where an agent will call the script. The probe in step four is the useful part: it proves the version, token, enrollment and network path with one command that cannot change anything on the pull request.
- Confirm the version with
gh --version. It must report 2.105.0 or later; the cli/cli Releases page shows 2.105.0 published on November 18 with thegh eventcommand set. - Confirm the host and token with
gh auth status. The preview serves github.com only; GitHub Enterprise Server and GHE.com are not supported, and gh fails before sending a request to them. Issue #15070 notes the service admits GitHub App installation tokens when their account is enabled for the preview, but only user tokens have been exercised, so start with a user token. - Confirm enrollment. Event Streams is in preview on GitHub.com and the account behind the credential must be enabled; the changelog links the waitlist.
- Run the probe below against any pull request you can read, with a 15-second timeout.
- Read the exit status. Status 8 means the stream attached, nothing happened, and the timeout fired: access works. Any other non-zero status means read stderr, where missing preview access, an inaccessible pull request and the subscription limit each get a specific message.
- Run
gh event subscription list. The probe’s subscription is still there, becausegh event listendoes not delete subscriptions on exit. The cleanup section deals with that.
Illustrative probe, with the expected observations as comments:
gh event listen \
--resource https://github.com/OWNER/REPO/pull/123 \
--event com.github.pull_request.review.submitted.v1 \
--timeout 15s
# stderr: Listening for events. (then a reminder to read the current state now)
# ...15 seconds pass with no review...
echo $?
# 8 -> timeout reached; preview access and the stream both work
If the probe exits immediately with a non-zero status other than 8, do not move on. The script below treats that exact situation as “Event Streams is unavailable here” and routes to the fallback, but you want to know why before an agent depends on it.

Build the wait-for-pr script
The script has two modes. review waits for a submitted review; checks waits until no check suite is pending. Its exit codes are the contract the agent reads: 0 means there is something to act on, 1 means checks finished with a failure, 8 means it timed out with nothing new, and 3 means Event Streams is unavailable and the agent should fall back.
#!/usr/bin/env bash
# wait-for-pr.sh: block until a PR gets a review or its check suites finish,
# then print the PR's current state. Needs gh 2.105.0+ and Event Streams preview access.
# wait-for-pr.sh review <pr-url> [timeout] (default timeout 30m)
# wait-for-pr.sh checks <pr-url> [timeout]
# Exit: 0 act on it | 1 checks failed | 8 timed out | 3 Event Streams unavailable
set -u
mode="${1:?review or checks}"; pr="${2:?pull request URL}"; timeout="${3:-30m}"
max_rounds="${MAX_ROUNDS:-6}"
handled="${HANDLED_FILE:-$HOME/.cache/wait-for-pr.handled}"
mkdir -p "$(dirname "$handled")"; touch "$handled"
case "$mode" in
review) event=com.github.pull_request.review.submitted.v1; jq_expr=.data.api_url ;;
checks) event=com.github.pull_request.check_suite.status.changed.v1; jq_expr=.data.conclusion ;;
*) echo "mode must be review or checks" >&2; exit 2 ;;
esac
# Field name 'reviews' is not in this guide's sources: confirm it with gh pr view --help.
review_count() { gh pr view "$pr" --json reviews --jq '.reviews | length'; }
# gh pr checks exits 8 while checks are pending.
checks_state() { gh pr checks "$pr" >/dev/null 2>&1; echo $?; }
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
round=1
while [ "$round" -le "$max_rounds" ]; do
before=0; [ "$mode" = review ] && before="$(review_count)"
gh event listen --resource "$pr" --event "$event" --timeout "$timeout" \
--jq "$jq_expr" >"$tmp/out" 2>"$tmp/err" &
pid=$!
# 1. Wait up to 30 s for the stream to attach, or for the listener to fail fast.
for _ in $(seq 1 30); do
grep -q 'Listening for events.' "$tmp/err" && break
kill -0 "$pid" 2>/dev/null || break
sleep 1
done
# 2. Re-read now: changes made before the attach are never replayed.
if grep -q 'Listening for events.' "$tmp/err"; then
if [ "$mode" = review ] && [ "$(review_count)" -gt "$before" ]; then
kill "$pid"; echo "review landed before attach"; gh pr view "$pr"; exit 0
fi
if [ "$mode" = checks ]; then
s="$(checks_state)"
if [ "$s" != 8 ]; then
kill "$pid"; gh pr checks "$pr"; [ "$s" = 0 ] && exit 0; exit 1
fi
fi
fi
# 3. Wait for the listener to exit: event (0), timeout (8) or error (anything else).
wait "$pid"; status=$?
if [ "$status" = 8 ]; then
echo "timed out after $timeout"
if [ "$mode" = checks ]; then gh pr checks "$pr"; else gh pr view "$pr"; fi
exit 8
elif [ "$status" != 0 ]; then
cat "$tmp/err" >&2
echo "event stream unavailable; fall back to polling" >&2
exit 3
fi
# 4. The event says something changed. The re-read decides what it means.
if [ "$mode" = review ]; then
url="$(head -n1 "$tmp/out")"
if grep -qxF "$url" "$handled"; then round=$((round+1)); continue; fi
echo "$url" >>"$handled"
gh api "$url"; gh pr view "$pr"; exit 0
fi
echo "check suite finished: $(head -n1 "$tmp/out")"
s="$(checks_state)"
if [ "$s" = 8 ]; then round=$((round+1)); continue; fi
gh pr checks "$pr"; [ "$s" = 0 ] && exit 0; exit 1
done
echo "gave up after $max_rounds rounds" >&2
exit 8
Save it as scripts/wait-for-pr.sh and mark it executable with chmod +x. Here is why each block is shaped the way it is.
- Take a baseline before subscribing. In review mode the script counts reviews first. If the count is higher after the stream attaches, a review landed in the gap between the agent’s last look and the attach, and the script reports it instead of waiting for an event that will never come.
- Pick a
--jqexpression per mode..data.api_urlgives the review the event points at;.data.conclusiongives a finished suite’s result, such assuccessorfailure. #15072 says--jqand--templateare validated before subscribing, so a broken expression fails at once rather than after a long wait. - Watch the local stderr file for the attach. The loop reads a file on disk once a second for up to 30 seconds; it never calls GitHub. If the listener dies first, the loop stops early and the exit status takes over.
- Re-read after the attach. This is the step the stream’s own reminder asks for. In checks mode the script asks
gh pr checksdirectly: status 8 means something is still pending, so it keeps waiting; anything else means the result is already in. - Branch on the listener’s exit status. 0 is an event, 8 is the timeout, and anything else is an error such as missing preview access or an unsupported host. Only the error path sends the agent to the fallback.
- De-duplicate on
data.api_url. The sources do not promise exactly-once or ordered delivery, and the listener reconnects on its own, so the script records each handled review URL and listens again if it sees one twice. PointHANDLED_FILEat a per-agent path if several agents share a machine. - Loop checks mode while anything is pending, with a cap.
MAX_ROUNDSdefaults to six listens. If CI genuinely needs more, raise it deliberately rather than removing it.
Two caveats belong next to the code. Neither the reviews JSON field nor passing a full URL to gh api is documented in this guide’s sources; both are standard gh behavior, so confirm them with gh pr view --help and gh api --help on your build. And the attach check matches the literal text Listening for events. from the #15072 description; preview output can change, so re-run the access probe after every gh upgrade.
Waiting on CI: one check-suite event is not a green build
cli/cli #15081 added com.github.pull_request.check_suite.status.changed.v1, sent when a check suite on the head commit of a pull request completes, with data.conclusion carrying the result. A check suite is the group of checks from one source, such as one workflow run, and a pull request usually has several. Each suite sends its own event. The #15081 help text says it plainly: waiting for all checks means reading them after each event and running the listener again while any are pending. The PR also explains why its own hint leaves out --count: the number of suites is not known in advance, so a fixed count either exits early or waits for events that never arrive.
The release notes show the one-line form, gh event listen --resource <PR URL> --event com.github.pull_request.check_suite.status.changed.v1 --jq .data.conclusion, and the #15081 test run shows it printing failure once a run completed and exiting after that first event. The script’s checks mode wraps that line in the loop the help text describes:
- Listen for one check-suite event with a timeout.
- When it arrives, print the conclusion for the log, but do not decide anything from it.
- Run
gh pr checks <PR URL>and read its exit status. - If the status is 8, something is still pending: listen again, up to
MAX_ROUNDS. - If the status is 0, nothing is pending or failing: report green and stop.
- Any other status: report the failing checks with
gh pr checksoutput and stop, so the agent’s fix loop takes over.
One open thread from the automated review of #15081 is worth knowing: it flagged that pending commit statuses can cause indefinite waits in this kind of loop. Commit statuses are not check suites, so if your repository still reports some CI through statuses, an event-driven wait may never be woken by them. The script’s timeout and round cap bound that case; it ends in status 8 with the current checks printed, not in an endless wait.
When the result is a failure, the next problem is the fix loop itself, and capping retries matters as much as waiting well; the CI agent fix-loop guards guide covers that, and agentic CI/CD covers the pipeline around it.
Worked example: case pr:review-wait-01
The case is an illustrative pull request, https://github.com/OWNER/REPO/pull/123, opened by an agent that has requested one human review and has three check suites (build, lint, e2e) on its head commit. The agent runs scripts/wait-for-pr.sh with a 30-minute review timeout and a 45-minute checks timeout. The expected results below are illustrative observations derived from the documented behavior, not runs performed for this article.
| Input | Action | Expected result |
|---|---|---|
pr:review-wait-01, review mode, PR OWNER/REPO/pull/123; reviewer approves 12 minutes after the attach |
scripts/wait-for-pr.sh review https://github.com/OWNER/REPO/pull/123 30m |
Illustrative: stderr shows Listening for events.; the post-attach count is unchanged; the listener exits 0 after one event; stdout holds the review’s data.api_url; the script prints that review and the PR, then exits 0 and the agent acts once |
pr:review-wait-01, review mode; the reviewer approves during the seconds between the agent’s last read and the attach |
Same command | Illustrative: the review count after attach is one higher than the baseline; the script kills the listener, prints review landed before attach and the PR, and exits 0 without waiting for an event that will never be replayed |
pr:checks-wait-01, checks mode on the same PR; lint finishes first with success while build and e2e still run |
scripts/wait-for-pr.sh checks https://github.com/OWNER/REPO/pull/123 45m |
Illustrative: the listener exits 0 and the script logs check suite finished: success; gh pr checks exits 8 because two suites are pending; the script listens again in round 2 and does not report green |
pr:checks-wait-01, checks mode; e2e is the last suite and ends in failure |
Same command, round 3 | Illustrative: the event prints failure; gh pr checks returns a non-zero status other than 8; the script prints the failing checks and exits 1, handing over to the fix loop |
pr:review-wait-01, review mode; nobody reviews within 30 minutes |
scripts/wait-for-pr.sh review https://github.com/OWNER/REPO/pull/123 30m |
Illustrative: the listener exits with status 8; the script prints timed out after 30m and the current PR, then exits 8; the agent reports that no review arrived and stops |
pr:review-wait-01, review mode; the account is not enrolled in the Event Streams preview (the API answers 403) |
Same command | Illustrative: the listener prints its specific missing-preview-access message on stderr and exits non-zero; the script echoes stderr and exits 3; the agent switches to the fallback |
pr:review-wait-01, review mode against a GHES URL, https://ghe.example.com/OWNER/REPO/pull/123 |
scripts/wait-for-pr.sh review https://ghe.example.com/OWNER/REPO/pull/123 30m |
Illustrative: gh fails before sending any request because only github.com serves the API; the script exits 3; the agent uses the fallback |
pr:review-wait-01, review mode; the account is at its subscription limit |
Same command as row 1 | Illustrative: the error message names the limit and suggests gh event subscription list and delete; the script exits 3; run the cleanup in this guide, then rerun |
Three decisions in that table carry the lesson. In row two, the baseline and the post-attach re-read turn a guaranteed timeout into an immediate, correct answer. In row three, the agent sees a successful event and still refuses to call the build green, because the event describes one suite and the re-read describes the pull request. In rows six to eight, every way the stream can be unavailable ends in the same exit code, so the agent needs exactly one fallback rule instead of three.
The success check for this case is behavioral: the agent wakes on the event, re-reads, and acts once, and its transcript shows one listener per wait rather than a column of gh pr view calls. The failure check is the opposite: if the transcript ever shows the agent merging or reporting green right after a single success conclusion, the instruction block below was not followed.
Drop-in instruction block for your agent
Paste this into AGENTS.md, CLAUDE.md or your harness’s equivalent instruction file. It names the script, states the exit-code contract in words the model can follow, and closes the loopholes the evals found.
## Waiting on pull requests
- Do not poll a pull request with sleep loops around gh pr view, gh pr checks or gh api.
- After you push or request review, run: scripts/wait-for-pr.sh review <PR URL> 30m
- To wait for CI, run: scripts/wait-for-pr.sh checks <PR URL> 45m
- Wait for the command to exit. Do not use gh event listen --follow.
- Exit 0: read the printed state and act once on it.
- Exit 1: checks failed. Read the gh pr checks output, fix, push, then wait again.
- Exit 8: nothing happened before the timeout. Report that and stop unless told to keep waiting.
- Exit 3: Event Streams is unavailable. For CI use: gh pr checks <PR URL> --watch --interval 30 --fail-fast
For reviews, run gh pr view <PR URL> at most once every 5 minutes, at most 6 times.
- One check-suite event never means all checks passed. Only gh pr checks decides that.
- If the pull request is closed without merging, stop waiting.
- When your work on this pull request is done, run scripts/cleanup-subs.sh <PR URL>.
Before you rely on it, walk through this checklist:
- [ ] The script path in the block matches where you saved it, and the agent’s sandbox lets it run
gh. - [ ] The agent runs the script as one command and waits for its exit, which is the moment harnesses resume an agent.
- [ ]
--followis banned for unattended work; #15078 found it still risky even when the skill limits it to review loops. - [ ] The fallback intervals and attempt caps are written as numbers, so the model cannot invent its own polling rate.
- [ ] The block tells the agent to stop on a closed, unmerged pull request, which the gh skill also teaches.
- [ ] For headless runs, the same block is loaded; the Claude Code headless mode guide shows how instructions reach
claude -p.
The block decides when the agent waits, not what it is allowed to do afterwards. Merge authority stays with your review policy; AI PR review agent policy sets out why agents propose and humans merge.
Troubleshooting by symptom
Most failures fall into a handful of patterns. Read stderr first: #15072 routes every status message there, and the error cases each get a specific message.
| Symptom | Likely cause | Fix |
|---|---|---|
| Agent never wakes after the review lands | Listener started with --follow, so it never exits |
Remove --follow; harnesses resume on exit, not on output |
| Script waits to timeout although a review exists | Review landed before the attach and the attach took longer than 30 seconds to appear | Read the PR manually; raise the attach wait; check stderr for reconnects |
| Immediate failure mentioning an unsupported type | Typo or short name in --event; the server answers 422 |
Use the full type name from gh event listen --help |
| Error naming the subscription limit | Old subscriptions still count against the account | Run the cleanup steps below, then retry |
| Error about an expired subscription | You attached with --subscription ID after 24 hours |
Listen with --resource; gh recreates an expired subscription itself |
Listening for events. appears more than once |
The stream dropped and reconnected with backoff up to 30 seconds | Treat each attach as a reason to re-read; the script re-reads after every exit |
| Exit 8 and the agent is unsure what it means | Both the listener timeout and pending gh pr checks use status 8 |
In the script, 8 only ever means “timed out, nothing new” |
| Checks wait never ends before the cap | CI reported through commit statuses rather than check suites | Keep the timeout and round cap; confirm the status with gh pr checks |
If you run many agents at once, a waiting agent and a stuck agent look the same from the outside. Put the script’s exit code and the timeout in your logs so a dashboard can tell them apart; the stall flags and keepalive guide covers that side.
Subscription inventory and cleanup
gh event listen deliberately leaves subscriptions behind. #15072 explains that they are shared per user, resource and exact event set, so another listener may be using the same one, and they expire after 24 hours anyway. cli/cli #15073 adds the other constraint: each account can hold a limited number of active subscriptions, and a new one is rejected at the limit. An agent that waits on many pull requests a day can reach that limit long before the oldest subscriptions expire.
The inventory command lists the caller’s active subscriptions newest first, following pagination up to --limit (default 30). On a terminal it prints a table with ID, resource, event types and a relative expiry; piped, it prints tab-separated rows; --json exports id, resourceUrl, eventTypes, createdAt, expiresAt, url and eventsUrl. The API reports no total count, so the header says it is showing the most recent subscriptions when the page is full.
- Inventory:
gh event subscription list --limit 100 --json id,resourceUrl,eventTypes,expiresAt. - Inspect one before deleting:
gh event subscription view <id> --json id,resourceUrl,eventTypes. - Delete only subscriptions for pull requests whose work is finished, using the script below.
- Confirm with
gh event subscription list; with nothing left it reports no event subscriptions.
#!/usr/bin/env bash
# cleanup-subs.sh <pr-url>: delete this account's event subscriptions for one PR.
set -eu
pr="${1:?pull request URL}"
gh event subscription list --limit 100 --json id,resourceUrl \
--jq ".[] | select(.resourceUrl == \"$pr\") | .id" |
while read -r id; do
gh event subscription delete "$id"
done
Run it after a dry look at step 1’s output, because the resourceUrl must match the URL you pass character for character, and the sources do not say whether the API normalizes it. Deleting a subscription that a second listener still uses will end that listener’s stream; cli/cli #15080 in the 2.105.0 notes made gh report a deleted subscription clearly, so the other agent sees an error rather than silence and falls back. Keep cleanup at the end of a pull request’s life, not at the end of each wait. That habit of owning the side effects your agents create is the same one AgentOps asks for across a fleet.
Fallback when Event Streams is unavailable
Event Streams is a preview on GitHub.com only. Some of your machines, accounts or repositories will not have it, and an agent that cannot wait at all is worse than one that polls politely. The script folds every unavailable case into exit 3, so the fallback is one decision.
| Condition | What the agent sees | Fallback |
|---|---|---|
| Account not enrolled in the preview | Specific missing-access message, exit 3 | Polling below; request waitlist access |
| GHES or GHE.com repository | gh fails before any request, exit 3 | Polling below, permanently for that host |
| gh older than 2.105.0 | gh event is an unknown command, exit 3 |
Upgrade gh, then rerun the access probe |
| Subscription limit reached | Limit message, exit 3 | Run cleanup, retry once, then poll |
The polling path still has rules:
- For CI, use
gh pr checks <PR URL> --watch --interval 30 --fail-fast. The manual documents--watchto watch checks until they finish,--intervalwith a default of 10 seconds, and--fail-fastto exit on the first failure. Add--requiredif only required checks matter. - For reviews, run
gh pr view <PR URL>at most once every five minutes and at most six times, then report and stop. - Log that the agent used the fallback, with the reason from stderr, so you can see which machines need enrollment or an upgrade.
- Re-run the access probe after any gh upgrade or enrollment change and switch the machine back to event waits once it exits 8.
Polling with numbers is still far better than an agent choosing its own sleep interval. When you coordinate several agents, decide the fallback once in the shared instruction file rather than per agent; the multi-agent command center guide is about keeping that kind of policy in one place.
What GitHub’s agent evals show about polling habits
The gh maintainers did not assume agents would use the new command. cli/cli #15078 added an eval suite with six pull request scenarios where a scripted second account reviews, merges or closes the pull request. The prompts never name a waiting command or tell the agent to avoid polling. Each scenario ran once without the gh skill and once with it, using gpt-5.6-luna and a 300-second agent budget.
The chart is one trial per cell, which the PR itself calls evidence of behavior, not a success rate. Still, the failure reasons line up with the rules in this guide:
- Without guidance, an agent in notify-review polled
gh pr viewwithsleep 30and ignored the hint gh printed; written instructions beat hints. - Without guidance, listen-at-limit failed because the agent polled instead of freeing a subscription slot; cleanup is part of the wait, not housekeeping.
- With the skill, full-delegation failed because the agent used
--followand read its output with two 120-second waits, so the approval arrived during the first wait and the agent resumed too late to merge. - review-loop deliberately submits its first review before a listener is guaranteed to be attached, so the agent must listen first or read the pull request after attaching, which is exactly the post-attach re-read in the script.
The changelog adds that gh pr create, gh pr view, gh run view, gh run watch and gh api now suggest gh event listen instead of polling, so agents may find the command on their own. The evals show why discovery is not enough: a hint can be ignored, and a correct listener can still be used badly. Your instruction block and script make the behavior predictable, and the underlying client in cli/cli #15071, with its specific errors for unsupported hosts, missing access and the subscription limit, gives the script clear exits to branch on.
Sources
- Wait for pull request events with GitHub CLI, GitHub Changelog, November 18, 2026.
- Event streaming (2/11): Add gh event listen, cli/cli pull request #15072.
- Event Subscriptions API support in gh (preview): PR stack overview, cli/cli issue #15070.
- Event streaming (1/11): Add a server-sent events reader and an Event Subscriptions API client, cli/cli pull request #15071.
- Event streaming (3/11): Add gh event subscription list, cli/cli pull request #15073.
- Event streaming (8/11): Add agent evals for event-driven waiting, cli/cli pull request #15078.
- Event streaming (11/11): Support check suite events, cli/cli pull request #15081.
- Releases: GitHub CLI 2.105.0, cli/cli on GitHub.
- gh reference manual, GitHub CLI.

