Open Source · MIT License · Node 22.13+

pollhook

GitHub webhook deliveries without webhooks.

Poll the GitHub REST API with a read-only token and turn changes into GitHub-shaped events. Wait for CI in scripts and agents, stream repository activity, or feed local webhook handlers without admin rights, a public URL, or a GitHub App.

npm install -g pollhook

Free and open source (MIT). Reading the GitHub API costs nothing; the rate limit is 5,000 requests an hour per token, and a 304 doesn't count against it.

pollhook
$ pollhook init --repo acme/app --events workflow_run,pull_request
wrote /home/you/.config/pollhook/config.json
next: pollhook status
$ pollhook run 1234567890
{"name":"CI","conclusion":"success","head_sha":"abc1234","url":"https://github.com/acme/app/actions/runs/1234567890"}
$ echo $?
0
$ pollhook emit --brief
14:02:11 acme/app pull_request opened 42 Add retry to the uploader
14:03:48 acme/app workflow_run completed 1234567890 CI success
14:05:20 acme/app pull_request closed 42 Add retry to the uploader

Why pollhook?

Reliable GitHub event polling designed for fast local workflows, agent loops, and CI scripts.

No webhook or admin rights

Works with any personal access token or existing gh auth login that can read the repository. You don't need repository administration rights, no public URL or ngrok tunnel, no GitHub App installation, and zero orphaned webhooks left in repo settings.

Waits that exit with the right code

A lightweight, robust gh run watch alternative. Wait for GitHub Actions runs from the CLI with commands like pollhook run <id> that exit 0 on success, 1 on failure, and 8 on timeout. Drop it straight into shell scripts and autonomous agents.

One daemon, zero wasted quota

A single local daemon serves every waiter and consumer over a fast unix socket. Polls use HTTP If-None-Match ETags: unchanged repositories return 304 Not Modified, consuming zero rate limit quota.

Quick start

Three quick steps to poll GitHub events locally and wait for CI workflows.

  1. Install pollhook

    Requires Node 22.13 or newer (utilizes native unflagged node:sqlite store):

    npm install -g pollhook
  2. Generate configuration

    Writes ~/.config/pollhook/config.json with selected repositories and events:

    pollhook init --repo owner/name --events workflow_run,pull_request
  3. Wait or stream events

    The daemon starts itself automatically on the first command and exits after 30 idle minutes (stop anytime with pollhook stop):

    pollhook run 1234567890

What you can do

Built for automation, terminal observation, and local integration testing.

Wait in scripts and agents

pollhook run, checks, and pr --until merged block execution until the remote action finishes. Perfect for AI coding agents, release scripts, and automated validation.

Watch a live stream

pollhook emit --brief outputs human-readable events in real time. If the daemon restarts, emit automatically reconnects with backoff and replays missed deliveries from local storage.

Feed a local webhook handler

Set deliver.url to a loopback address. pollhook delivers genuine GitHub-formatted HTTP POST requests with X-GitHub-Event and HMAC X-Hub-Signature-256 without public tunnels.

Honest limits

Polling inspects state rather than an authoritative event journal, so behavior differs naturally from server-pushed webhooks. Transitions that leave no persistent state behind (such as an issue comment created and immediately deleted between polling intervals) cannot be detected.

Very short-lived intermediate states can be coalesced: a fast workflow run may transition directly from queued to completed in a single delivery. pollhook is strictly read-only: it never writes to GitHub, requires no write privileges, and opens no listening network ports.

v0.9.0 author: radomir.dev