A script is waiting for a pull request check, but nothing in the workflow tells it when to continue.
Use GitHub CLI 2.105.0 event listening only if the account has GitHub Event Streams preview access, the repository is on GitHub.com, and a script or agent genuinely needs to wait for PR changes. Keep ordinary CI triggers in place, and use a suitable remote Mac for Xcode validation.
This guide is for developers and CI engineers maintaining iOS or macOS projects who need to connect PR activity to a later build or test.
If the workflow only needs GitHub Actions to start CI, the existing trigger is usually the simpler choice.
Last updated November 19, 2026. The release date and feature scope were checked against the GitHub CLI announcement and the GitHub Event Streams documentation.
Choosing the right fit for GitHub CLI 2.105.0 PR event listening
GitHub announced GitHub CLI support for GitHub Event Streams on November 18, 2026. The feature is in preview, so the version number alone does not guarantee access. Check the account’s eligibility and the repository’s platform before planning around a listener. The release announcement describes the feature as a way to wait for pull request events.
Use event listening when a process needs to continue after a review, branch update, PR state change, or check-suite activity. For example, an agent might pause after submitting a change, then fetch the latest PR and check information before deciding whether to run a local verification task.
It is not a replacement for a CI trigger. GitHub Actions or another CI system should still start repeatable jobs when the repository receives the configured activity. Event listening is more useful as a signal for a separate process that needs to react, inspect current state, or coordinate work that is not already handled by the CI workflow.
Choose the path that matches the job:
- If a GitHub Actions workflow should run for every matching PR update, keep the workflow trigger. A listener adds another moving part without improving the trigger itself.
- If a long-running script or agent must wait for an event and then make a decision, evaluate GitHub Event Streams after confirming preview access.
- If the next action requires Apple tooling, treat the event as a prompt to verify or schedule work—not as evidence that an Xcode build has passed.
- If the repository is not hosted on GitHub.com, do not assume this preview applies. The published scope is GitHub.com pull requests, not GitHub Enterprise Server or GHE.com.
This is the key distinction: an event can tell a process that something changed; it does not certify that the current PR is ready or that its checks have all passed.
Readiness checks before creating a subscription
First check the command-line version and authentication on the Mac that will run the listener. Run gh --version and compare the installed release with the GitHub CLI release record. GitHub’s announcement identifies version 2.105.0, but preview access remains a separate requirement. Do not infer eligibility from a successful installation.
Then check authentication. The account used by gh needs to be able to read the target PR and its relevant status. Use gh auth status to inspect the active login, or follow the official gh auth login instructions if the Mac has not been authenticated. Credentials with insufficient repository access can cause a listener or later status query to fail even when the account has access to the feature.
For a remote Mac, verify that the account, repository, and host are the intended ones before creating anything. A shared CI machine may retain a different gh login from an interactive developer session. Check the active identity in the same shell environment that will run the listener, especially when a scheduled task or service account starts it.
The runnervps getting-started guide can help confirm how to access a remote Mac before installing or configuring developer tools. Access to a Mac does not itself grant GitHub preview eligibility, PR permissions, or Xcode project access; those are separate checks.
The preview boundary matters. The announcement and documentation describe GitHub.com pull requests. Do not extend that claim to GitHub Enterprise Server or GHE.com unless current official documentation explicitly adds them.
Creating a subscription and starting gh event listen
Use the target PR as the anchor for the subscription. Decide which changes should wake the waiting process before configuring it: review activity, branch updates, PR state changes, or check-suite completion may call for different responses. Subscribing broadly without a clear next action can create unnecessary notifications and more state for the script to manage.
The command group is documented in the official manuals for creating an event subscription, listing subscriptions, and listening for events. Check those pages for the current flags and accepted event names before running commands: preview interfaces can change, so a copied command from an old example is not a reliable configuration source.
A safe setup sequence is:
- Select the pull request by its URL or repository and PR reference, following the current
gh event subscription create --helpoutput. Confirm that the subscription points to the intended repository and PR. - Choose only the documented event types needed by the workflow. A review event may prompt a fresh review-state check; a branch update may prompt a new validation run. Do not assume event labels or payload fields without checking the official command documentation.
- Create the subscription using the documented syntax, then use
gh event subscription listto verify that it appears with the expected scope. - Start the listener with
gh event listen, using the documented options for the subscription. Keep the process in a supervised shell, service, or job that records its exit state. - Test the handoff with a controlled PR change and confirm that the listener receives the expected notification before connecting it to a consequential task.
The exact command options should come from the CLI help and the linked manuals, not from a guessed command template. This matters because repository selection, subscription scope, and event names determine what the process will receive. If the documentation changes an option or subscription lifecycle, update the setup before relying on it.
A listener only observes events while it is running and subscribed. It should not be treated as a history query that reconstructs everything that happened before it started. If a review or branch update occurred before the subscription or listener was active, fetch the current PR state directly rather than expecting that earlier change to arrive as a new notification.
Handling an event by checking current state
Treat the event as an instruction to re-check, not as the final answer. Events may arrive while PR state is changing, and the order in which a process receives notifications is not a safe substitute for reading the current state. After receiving a relevant event, query the PR, its review information, or its check status using the authenticated CLI context.
This is also the answer to how gh event listen can watch PR review activity on a remote Mac: create a subscription for the needed documented event, start the listener, and have the consumer fetch the latest review state after notification. The listener does not replace the state query. If the purpose is to decide whether a review has been completed or changes are required, base that decision on the current PR data, not on an assumption about a single notification.
For check completion, use the current PR checks as the source of truth. The official gh pr checks manual documents the command for inspecting checks associated with a pull request. A PR can have multiple check suites or individual checks. One completion event does not prove that every required check has finished, and one successful check does not mean the overall PR is green.
A robust consumer should:
- Identify the repository, PR, and commit associated with the notification.
- Query the current PR checks after receiving a relevant event.
- Determine whether all checks required by the project are complete and successful.
- Re-query if the result is still pending or if the PR head has changed.
- Record the final state with the commit identifier, rather than attaching a result only to the PR number.
This avoids a common race: a notification arrives for an earlier commit, while the PR has already been updated. The script must confirm that the commit it is about to validate is still the current head. If not, it should discard or mark the stale work and inspect the latest state.
Connecting PR events to Xcode CI on the remote Mac
Separate event delivery, job scheduling, and project validation. The listener signals that something may require attention. A scheduler or script decides what to do next. Xcode, the project’s build scripts, and its tests perform the actual Apple-platform validation on a macOS environment that meets the project’s requirements.
For example, after a check-related event, a script can query current PR status and compare the PR head with the revision already tested. If the revision is new and the required upstream checks have reached the expected state, the script can schedule a remote Mac build or test. The build result must then be attached to the exact commit tested. The event itself is not an Xcode result and must never be reported as a passing build.
A useful run record contains:
- The repository and PR reference.
- The commit identifier selected for validation.
- The event type and time the listener observed it.
- The latest check state retrieved from GitHub.
- The Xcode build or test command and its result.
- Any failure reason, retry decision, or required human review.
This record helps distinguish “the listener received a notification” from “the project passed validation.” It also makes debugging possible when the listener is healthy but the build fails, or when the build succeeds on an outdated commit.
For projects already using GitHub Actions, retain the normal workflow triggers and required checks. An event listener can coordinate a separate action, such as prompting an agent to inspect a PR or initiating validation on a dedicated Mac, but it should not silently become the only mechanism that starts essential CI. A process that exits, loses credentials, or misses connectivity must not leave required checks permanently unstarted.
If the remote Mac needs a reproducible command-line toolchain, use the runnervps documentation as a starting point for access and environment setup. Then document the project-specific Xcode version, signing requirements, secrets handling, and test command internally; those requirements vary by project and should not be inferred from the event stream.
Recovering after a disconnect or subscription expiry
Do not assume that GitHub Event Streams will replay every PR event missed during a disconnection. The safe recovery action is to reconnect, inspect the current subscription state, and fetch the latest PR and check status. If the listener was down during a branch update or review change, the current state matters more than whether the missing notification is replayed.
Use gh event subscription list to inspect subscriptions, then follow the current subscription documentation for their lifecycle and any renewal or cleanup requirements. The preview’s lifecycle rules may change, so check the official guide and CLI help when deploying or updating the process. Avoid writing an assumed expiration period or token-renewal schedule into automation unless the current documentation specifies it.
Recovery should be deliberate:
- Restart the listener under the same intended account and verify that it is attached to the expected subscription.
- Fetch the latest PR head, reviews, and checks before resuming downstream work.
- Compare the current commit with the last commit recorded as tested.
- Re-run only the work that is still needed for the current revision.
- Remove obsolete subscriptions using the documented command or process, rather than leaving stale listeners active.
This workflow has a clear trade-off. Event listening can let a script or agent react without repeatedly polling for a PR change, but it introduces preview eligibility, authentication, a long-running process, and recovery work. A regular CI trigger has less listener-specific maintenance and is usually the better fit for predictable build automation. Where a script must wait and make a decision, use the event as a wake-up signal and make the decision from fresh GitHub state.
Decision branches:
- If the account lacks preview access, use an existing GitHub Actions trigger or another supported workflow instead of building around the listener.
- If the repository is not on GitHub.com, do not rely on this preview; choose a supported integration for that hosting platform.
- If the only requirement is repeatable Xcode CI, keep the established CI trigger and make sure a suitable Mac runner executes the build.
- If a script or agent must wait for PR activity and the access and platform conditions are met, use the listener as a signal, then query current PR and check state before acting.
For teams whose current build host is a Linux server, a shell-only PR notification cannot supply Apple’s project toolchain. That setup may still handle orchestration, but it cannot replace macOS validation where the project requires Xcode. A remote Mac is also not the right answer for every team: a local Mac may be simpler for an individual workflow, and a continuously busy, long-term host may justify purchasing dedicated hardware instead.
Before adding event listening, check whether the existing macOS build environment meets the project’s toolchain and availability needs. If the workflow needs an independent Mac execution host for a defined project period, compare the runnervps Mac plans with keeping the current setup. A Linux-only host can miss Apple-specific validation, a shared desktop may be unavailable when a job needs it, and a self-managed Mac adds hardware and maintenance responsibility. Renting a Mac can be a more flexible way to supply the execution environment for temporary or changing workloads—but it does not remove the need to verify GitHub access, event state, or build results.
Further reading
Run PR Checks on a Dedicated Remote Mac
Use a dedicated Apple Silicon Mac from runnervps to validate pull requests with your Xcode toolchain.
