DocsFlowQA
GitHub deploy hooks
Connect the TestFinch GitHub App once, pick a repository in a FlowQA project, and every successful deployment of that repository runs the project's regression against the deployed URL.
The commit gets a check named FlowQA: <project>, in progress while the run queues and then success or failure with a table of every test.
Nothing is added to your workflow files; the hook listens to GitHub's deployment events.
A hook can also check every pull request against its preview deployment, with one comment that stays up to date and a check you can require; see Pull request checks.
Three steps#
- In TestFinch, open Settings, then Integrations, and choose Connect GitHub. GitHub asks which repositories the app may see; the app needs to read deployments, write checks and, for pull request checks, read and write pull requests. GitHub also asks you to authorise the app as yourself, which is how TestFinch knows the installation is yours. You return to TestFinch, signed in as yourself, and TestFinch connects the installation to this workspace.
- In FlowQA, open the project's Settings, then Schedules & CI, and add a hook under GitHub: the repository, an optional GitHub environment name, the FlowQA environment, the tests, and whether to run against the deployment's URL.
- Deploy. When GitHub records the deployment as successful, the run starts and the check appears on the commit within seconds.
What produces a deployment event#
GitHub's deployment events come from whatever deploys your code and tells GitHub about it. Not every host does, and not every host puts the site's URL on the deployment. Checked on 2026-10-22 against public repositories using each host's own GitHub integration, and against each host's documentation:
| Host | Deployments for pull request previews | Environment name | Where the URL is | Production flagged with production_environment |
Notes |
|---|---|---|---|---|---|
| Vercel | Yes, for every push, previews and production | Preview and Production; in a repository with several Vercel projects, Preview – <project> and Production – <project> (with an en dash) |
environment_url (also target_url and log_url), the deployment's own URL such as https: |
No: production deployments also say false, and transient_environment is always false |
Deployment Protection is on for previews by default. A project can switch deployment_status events off in its Git settings. A pull request from a fork deploys only after a team member authorises it (Git Fork Protection). |
| Netlify | No | - | The commit status netlify carries the preview URL in target_url |
- | Reports through commit statuses, checks and a pull request comment; no deployment is created, so no hook runs. |
| Railway | Yes, for pull request environments and every other environment | <service> , for example web |
environment_url points at the Railway dashboard, not the site |
No (false everywhere); pull request environments set transient_environment: true |
The deployment URL is not the site, so a hook must use the environment's base URL; pull request mode cannot use Railway previews in v1. |
| Render | Yes, for service previews (since September 2024, from Render's documentation) | <branch> - <service> for the service itself; a preview's name was not observed |
environment_url (the "View deployment" link), on the preview's own onrender.com host |
Yes, true on the service's own deployments; not observed on a preview |
Previews are public; Render only adds X-Robots-Tag: noindex. |
| Cloudflare Pages | No | - | The Cloudflare Pages check run's summary lists the preview URL |
- | Reports through a check run and a commit status; no deployment is created. Pull requests from forks get no preview. |
- Heroku's GitHub integration creates deployments for auto-deploys and pipeline promotions.
- A GitHub Actions workflow can create one with the
deploymentspermission, for example throughchrnorm/deployment-actionor agh apicall. - Only a deployment status with state
successruns anything. Pending, failure, error and inactive are acknowledged and ignored.
If your deploys do not reach GitHub as deployments, keep using a CI trigger from your workflow instead; see the schedules and CI document.
Which URL the run uses#
A hook runs against the deployment's URL when the hook says so (the default) and the deployment carries an https: URL in its status or payload.
The project's chosen environment is pointed at that URL for the run only, and the URL's host is allowed for the run; nothing in the project changes.
Preview deployments therefore run against their own preview URL, and production deployments against production.
When the deployment carries no URL or an http: one, the run uses the environment's own base URL and the check's summary says why.
Tests whose steps navigate to an absolute URL go where they say; relative navigation follows the deployment.
Protected previews, such as Vercel previews behind Deployment Protection, answer the run with a login wall, so every test fails.
A pull request hook carries a protection bypass header for them; see Protected previews.
The check#
One check per run, named FlowQA: <project>; a project with more than 100 tests starts several runs and the checks are numbered (1 of 3).
The title counts passed and failed tests.
The summary names the run, the environment, the URL, the duration and links to the run in FlowQA.
The details hold a table of every test with its result, time and the failing step's error.
A cancelled or expired run completes the check as neutral with the reason.
Require the check in branch protection to block merging on a red regression.
Alerts, limits and history#
A hook's runs act as the person who created the hook, with their access, and alert the people named on the hook the way schedules and triggers do.
Runs count against the workspace's cloud run allowance and appear in the project's run history with the label deploy <sha> to <environment>.
Disconnecting GitHub in TestFinch revokes every hook in the workspace; uninstalling the app on GitHub does the same.
Either one also cancels the workspace's pull request runs that have not finished, without updating their checks, and forgets its pull request comments, which stay on GitHub as they were.
Pull request checks#
A pull request hook runs the project's regression against each open pull request's preview deployment. The pull request gets one TestFinch comment that is edited in place on every push, and its head commit gets a check with a fixed name that a team can require before merging.
Two modes#
Every GitHub hook has a mode, chosen under "Runs on" in the hook form.
- Deployments (
deployments, the default) is the behaviour described above: every successful deployment that matches the hook starts a run and reports a check on the commit. - Pull request previews (
pull_requests) runs only for a successful deployment whose commit is the head of an open pull request, and adds the comment, the fixed check name, trust and approval, a monthly cap per repository and supersession.
A team that wants both makes two hooks.
An existing deployments hook can be switched to pull request previews in place.
Production deployments never run a pull request hook: a deployment counts as production when GitHub flags it with production_environment, or when its environment name has a part equal to production, as in Vercel's Production and Railway's web / production.
Setting it up#
- Connect GitHub as in the three steps above, and make sure the installation has accepted the pull request permissions; see Existing installations.
- In FlowQA, open the project's Settings, then Schedules & CI, and add a hook under GitHub with "Runs on: Pull request previews".
- Fill in the repository, the GitHub environment (optional), the FlowQA environment, the preview hosts, which tests run (all, chosen suites or chosen tests), whether the check is required, what fork pull requests do, whether to skip drafts, screenshots in the comment, and an optional protection bypass header.
- Copy the check name the form shows into a branch ruleset if the check should block merging.
- Open a pull request. The check appears on the head commit as queued, "Waiting for the preview deployment", and the comment says the same. When the preview deployment succeeds, the run starts and both update; when it ends, both show the results.
Waiting for the preview#
A check waits for a successful preview deployment of its commit, from the deployment_status webhook.
TestFinch also looks the deployments up itself, when the check opens and again 2, 5, 15 and 60 minutes after, then hourly, so a success webhook that never arrived still starts the run.
When the commit's preview deployment ends in failure or error, the check completes as "Not run" with "The preview deployment of this commit failed."
When no preview deployment of the commit succeeds within 6 hours (a build that never ran, such as one a monorepo's ignored build step skipped), the check completes as "Not run" with "No preview deployment of this commit succeeded within 6 hours."
Both are failure on a required hook and neutral otherwise, as a refused preview host is.
A later successful deployment of the commit runs it as the next attempt, and Re-run on a waiting check looks for the deployment again at once.
If the repository deploys several previews per commit (an app and a Storybook, say), set the hook's GitHub environment, so a failure of another preview never ends the check.
The GitHub environment field offers the environment names the repository deployed to recently, newest first, up to 12 per repository. Transient environments, such as Railway's pull request environments, are left out, and a name is forgotten 90 days after its last deployment. You can still type any name.
The FlowQA environment must not be read-only, so production is refused; use a preview environment with throwaway test accounts, because the run types that environment's inputs into the preview.
Pull request runs use Chromium only, so the browser stays on the addresses TestFinch checked. A hook's other browsers are left out of its pull request runs, and a pull request hook with no Chromium combination is refused with "Choose a Chromium browser; pull request runs use Chromium only."
The form also estimates the cost of one push, for example "About 120 cloud test runs per push; this repository has used 900 of its 3,750 this month."
If the preview deployed before the pull request was opened, the run starts when the pull request opens. A draft pull request is skipped until it is ready for review, unless the hook turns "Skip drafts" off.
Which providers produce preview deployments#
A pull request hook needs a GitHub deployment for the preview, with the preview's own URL on it. From the table in What produces a deployment event:
| Host | Pull request mode in v1 | Why |
|---|---|---|
| Vercel | Yes | Every push creates a deployment with the preview URL in environment_url. |
| Render | Yes, for service previews | Previews are documented as GitHub deployments on their own onrender.com host. |
| Railway | No | The deployment URL is the Railway dashboard, not the site. |
| Netlify | No | No deployment is created, only a commit status. |
| Cloudflare Pages | No | No deployment is created, only a check run. |
A GitHub Actions workflow that creates a deployment with the preview's URL works too.
Preview host patterns#
A pull request hook names the preview hosts it accepts, and a deployment URL outside them is refused with the host named on the check and in the comment.
The URL must be https: on the default port, and its host must resolve only to public addresses.
The run's browser is pinned to the addresses TestFinch checked, so a DNS change after the check cannot send it elsewhere.
A pattern is a host name, lower case after international names are converted, with one trailing dot dropped.
- A
*may appear only at the start of the first label, once, and stands for one or more letters, digits or hyphens within that label. - A bare
*label must sit below a domain someone owns, never a public suffix:*.preview.acme.comand*.acme.vercel.apppass,*.vercel.app,*.appand*do not. *followed by a fixed part needs at least three fixed characters:*-acme.vercel.apppasses,*a.vercel.appdoes not.- A fixed part right below a public suffix that anyone can register under is refused:
*-acme.co.ukand*-acme.appdo not pass. - IP addresses in any notation,
localhost, single-label names and reserved names such as.local,.internal,.lanand.homeare refused. - A host that does not resolve, or that resolves to a private or reserved address, is refused when the run would start.
A pattern such as *-acme.vercel.app sits right below a platform's own suffix, where anyone can create a project with a matching name.
It is accepted with a warning: "Anyone can create a project named like this on vercel.app; TestFinch also checks the deployment came from the host."
A preview that matches only such patterns runs only when the platform's own GitHub App created the deployment: vercel[bot] for vercel.app, and a GitHub App login ending in [bot] for other platforms, never a person.
To avoid the warning, serve previews from your own domain, for example *.preview.acme.com.
The hook form checks the patterns as you type through POST /v1/projects/:projectId/qa/github-hooks/preview-hosts; see For agents.
Protected previews#
Vercel turns Deployment Protection on for previews by default, so without a bypass every test meets a login wall.
A pull request hook can carry one protection bypass header: for Vercel, x-vercel-protection-bypass with the project's "Protection Bypass for Automation" secret; for another host, the header name and value it documents.
- The run sends the header only on requests to the preview host, never to other hosts the page loads and never across a redirect to another host.
- With
x-vercel-protection-bypassthe run also sendsx-vercel-set-bypass-cookie: true, so Vercel sets its bypass cookie for the rest of the visit. - The value is stored encrypted and is write only: the API never returns it, and the hook shows only which header is set.
- A header that would change the request itself is refused with "Use a header name such as x-vercel-protection-bypass.":
host,cookie,content-length,transfer-encoding,connection,upgrade,te,trailer,keep-aliveand everyproxy-*name. - The value cannot contain line breaks.
Deployments hooks do not send the header.
Trust and approval#
A preview runs the pull request's code, and the run types the FlowQA environment's inputs, such as test account passwords, into it. So a pull request runs on its own only when it is trusted:
- its head branch is in the repository itself, since opening it took push access; or
- it comes from a fork whose author has write, maintain or admin access to the repository, as GitHub reports it for that person.
Any other pull request waits for approval. Its check completes as "Waiting for approval" with an "Approve and run" button, and the comment says who can approve: people with write access to the repository. TestFinch confirms the person who pressed it has write access, records their GitHub login, and runs that exact commit. A new push needs a new approval.
Set "Fork pull requests" to "Never run" (fork_prs: "never") to refuse untrusted pull requests instead of asking.
There is no setting that runs them without approval.
Requiring the check#
Each pull request hook reports one check per commit, named when the hook is created, FlowQA: <project name> unless you choose another.
The name does not change when the project is renamed or when the run is split into several parts, so a required check keeps matching.
Another hook of the workspace on the same repository cannot report the same check name.
To block merging on it, add the check name to a branch ruleset or branch protection rule as a required status check. TestFinch never edits your branch rules.
GitHub counts a neutral or skipped check as passing, so a required hook fails closed: a run that should have happened and did not is never neutral.
| What happened | Not required | Required |
|---|---|---|
| Every test passed | success | success |
| A test failed or was blocked, or a run part failed | failure | failure |
| Waiting for approval | action required | action required |
| Refused preview host, or the monthly cap reached | neutral | failure |
| The preview deployment failed, or none succeeded within 6 hours | neutral | failure |
| A run part cancelled or expired | neutral | failure |
| No tests ran | neutral | failure, "No tests ran" |
| Superseded by a newer commit, or the pull request closed | neutral | neutral |
A superseded check stays neutral even when required, because a merge uses the pull request's newest commit, which has its own check; a closed pull request cannot be merged.
GitHub does not deliver webhooks in order, so TestFinch keeps the updated_at of the newest pull request event it took for each pull request.
An older event (a push delivered after a later one, or a close delivered after the reopen) changes nothing: it supersedes no run, closes nothing and does not change the head.
A pull request read from GitHub that is older than that event is read again later instead of cancelling or starting a run.
If a run of the pull request's current head still ends superseded or closed, TestFinch opens the head's next attempt, and Re-run on a superseded check runs it while its commit still heads the pull request.
When GitHub keeps failing, TestFinch tries a check or a comment again with backoff, up to an hour apart, and after 8 tries says so on the hook. It then tries once a day for a week, and a check it could not complete keeps its last state meanwhile, which never passes a required check.
Rerun#
- Re-run on the check runs the hook's tests again against the same preview URL, as a new attempt with a new check of the same name. On a check still waiting for its preview, or one that stopped waiting, the new attempt looks for the deployment again. On a check waiting for approval, the new attempt asks for approval again and the earlier one is superseded, so one commit has one approval wait.
- Rerun failed tests, on a failing check, runs only the tests that failed or were blocked in the previous attempt, or the whole selection when none did.
Only people with write access see these buttons, and TestFinch checks that access again. "Re-run all checks" on the pull request does not rerun TestFinch in v1; use Re-run on the TestFinch check itself.
Caps and supersession#
Pull request runs draw on the workspace's cloud test runs and credits like any other run, and each repository also has its own monthly cap on pull request test runs. The default cap is a quarter of the plan's monthly cloud test runs: Free 250, Starter 750, Team 3,750 and Business 15,000, with no cap on Enterprise. A workspace admin can change a repository's cap, or set it back to the plan default, in Settings, Integrations, GitHub, under "Pull request checks".
When the cap would be passed, the run does not start and the check says "Monthly cap reached" with the numbers. When the workspace's cloud test runs and credits are used up, the run does not start either, and the check says why.
A newer commit cancels the older commit's queued or running run of the same hook and pull request; its check completes as "Superseded by
Screenshots and privacy#
A failing test in the comment can show a thumbnail of the failing step, at most five per comment. GitHub loads comment images through its image proxy, so each one is a public link that anyone who can read the pull request can open. The link is signed for one screenshot and expires when the run's artifacts do, after the plan's artifact retention; then it shows a "Screenshot expired" image.
"Screenshots in the comment" defaults to "Private repositories only" (comment_screenshots: "auto"), so public repositories get no screenshots unless the hook says "Always" (on); "Never" (off) turns them off everywhere.
When a private repository becomes public, TestFinch learns it from the next pull request or deployment event and rewrites every comment of the repository without the screenshots.
Links already posted stay valid until they expire, and GitHub keeps a comment's edit history, so make a repository public only after removing comments you do not want public.
Egress#
A pull request run loads code from the pull request, so its browser may reach the preview and the public internet only. The worker starts a forward proxy for each run, and the run's Chromium sends every connection through it, loopback included. That covers pages and frames, the next hop of every redirect, fetches, dedicated and shared workers, and WebSockets, including those opened inside a worker; service workers are off in pull request runs. For each connection the proxy looks the host up itself and connects to the exact address it checked, so a name cannot answer differently a moment later (DNS rebinding). The preview host always connects to the address TestFinch checked when the run started. The proxy refuses a connection when its host is:
- an IP address in a private, loopback, link-local (including
169.254.169.254), shared (100.64.0.0/10) or reserved range, IPv4 or IPv6, IPv4-mapped included; - a name without a dot,
localhost, or a name under.localhost,.internal,.localor.home.arpa; - a name any of whose addresses is in one of those ranges (each name is looked up once per run);
- an address the worker's operator listed in
FLOWQA_EGRESS_DENY, such as the worker machine's own public addresses; this holds for the preview host's own addresses as well.
What happens next depends on what asked:
- A page or frame that tries such a host, directly or through a redirect, fails the step with "Blocked
: ". The result is blocked, and no screenshot of the test is kept or linked from the comment. - A request, worker or WebSocket that tries one is refused all the same, but the test does not fail for it: nothing internal was loaded or shown.
The step says "Blocked a request to
: private or internal address.", its screenshots are kept, and the comment lists the warning under "Warnings". Pages that probe localhost(fraud and fingerprinting scripts, a development build's reload client) show up this way. - A name that does not resolve is never connected to either.
A page or frame that cannot load because of it fails the step with "Could not resolve
, so the page or frame could not load."; another request to it just fails, as it would anywhere. - A step names at most 20 refused hosts and counts the rest ("and N more blocked requests."); the comment lists at most five warnings per test.
A navigation that lands off the test's allowed hosts in a pull request run keeps no screenshot either, and the comment links none. WebRTC may use proxied connections only, so no UDP leaves the browser around the proxy. As a second layer, the browser context checks what it sees before it leaves, and every frame's final address is checked once it loads. Only workers that enforce this take pull request runs; an older worker is never handed one.
Remaining limits:
- The boundary lives in the worker's process, not in the network: any public address is reachable, on any port Chromium allows, the public address of the machine the worker runs on included unless the operator lists it in
FLOWQA_EGRESS_DENY. - Requests the worker sends for the run itself (the preview's own pages, probes and seeds) go to the preview's checked address only, without the proxy.
The comment#
One TestFinch comment per pull request covers every pull request hook of the workspace on that repository. It is created once and edited in place; if someone deletes it, the next update posts a new one.
It contains:
- one line per hook: the check name, the passed and failed counts, the commit, the preview URL and a link to the run;
- for each failing test: its name linked to the test, the failing step and its error, a screenshot when enabled, and the links "Open the run" and "File a bug", which opens the test's run history where the failure can be filed as a bug;
- the passed tests with their times, collapsed;
- why a run did not happen: waiting for the preview, waiting for approval and who can approve, a refused preview host, the cap reached, or superseded;
- how to run again;
- the last five earlier commits of the pull request, one line each, collapsed.
The comment stays within GitHub's 65,536 characters, failures first, and ends with "and N more in TestFinch" when it is clipped.
Existing installations#
Pull request checks need two more things from the GitHub App: the repository permission "Pull requests: Read and write" and the events "Pull request" and "Check run". GitHub asks each installation's owner to accept them; until then:
- deployments hooks keep working unchanged;
- Settings, Integrations, GitHub shows "Approve the new permissions on GitHub to use pull request checks." with an "Approve on GitHub" button for admins, and members see "Ask an admin to approve the new GitHub permissions.";
- the hook form disables "Pull request previews" with the same link;
- the API refuses a pull request hook with "Approve the new permissions on GitHub to use pull request checks." and the link in
error.details.accept_url.
Once the owner accepts, the banner disappears. If an owner later takes the permission away, the hook records the error, the check still reports, and the banner returns.
Pull request runs and their comments are kept for a year, then deleted.
For agents#
An agent with a member role sets this up through the API or the MCP tool. Creating and changing hooks needs a signed-in session token or the MCP connector, which signs in with OAuth. A personal access token is refused there: it can read the installation, list hooks, describe preview host patterns and list pull request runs, and with write scope it can also remove a hook or run one now, but it cannot create or change one.
Check the workspace's installation (any token works here):
curl -sS "$SNAG_API/v1/integrations/github?workspace_id=$WORKSPACE_ID" -H "Authorization: Bearer $SNAG_TOKEN"
{ "available": true, "connected": true,
"installation": { "installation_id": "777", "account_login": "acme", "account_type": "Organization", "repos": ["acme/shop"], "connected_by": "usr_...", "connected_at": "2026-10-11T09:00:00.000Z" },
"install_url": null, "manage_url": "https://github.com/settings/installations/777",
"permissions_ok": true, "missing": [], "accept_url": "https://github.com/organizations/acme/settings/installations/777" }
When connected is false, a workspace admin must open install_url in a browser; the API cannot install the app on the person's behalf.
When permissions_ok is false, missing lists what the installation lacks, such as ["pull_requests:write", "event:pull_request"], and the installation's owner accepts it at accept_url.
List, create and remove hooks (/v1/projects/:projectId/qa/github-hooks).
The list answer also carries permissions_ok, missing and accept_url, runnable_tests, suite_test_counts, repo_usage (each repository's pull request test runs this month and its cap), last_preview_hosts (the newest preview host per repository) and github_environments (the environment names each repository deployed to recently).
Creating one is run with a session token, not a personal access token:
curl -sS -X POST "$SNAG_API/v1/projects/$PROJECT_ID/qa/github-hooks" -H "Authorization: Bearer $SNAG_SESSION_TOKEN" -H 'content-type: application/json' \
-d '{"name":"Preview deploys","repo":"acme/shop","github_environment":"Preview","environment":"preview","use_deployment_url":true}'
{ "hook_id": "qtr_...", "project_id": "prj_...", "name": "Preview deploys", "repo": "acme/shop", "github_environment": "Preview", "environment": "preview",
"test_ids": [], "combination_ids": [], "use_deployment_url": true,
"mode": "deployments", "suite_ids": [], "preview_hosts": [], "preview_host_warnings": [], "check_name": null, "required": false, "fork_prs": "approval",
"skip_drafts": true, "comment_screenshots": "auto", "preview_bypass": null,
"alert_emails": ["you@company.com"], "alert_slack_channel": null, "alert_on": "failure",
"created_by": "usr_...", "last_delivery_at": null, "last_execution_id": null, "last_error": null, "revoked_at": null, "created_at": "2026-10-11T09:00:00.000Z" }
repo must be one of the installation's repos; environment is a FlowQA environment id; github_environment is GitHub's environment name and null means any; test_ids empty means every recorded test.
alert_emails, alert_slack_channel and alert_on (failure or always) are settable too and default to the creator's email on failure.
PATCH the same path with /:hookId to change any of these; DELETE revokes; POST /:hookId/run runs now against the environment's base URL.
A pull request hook adds these fields:
mode:pull_requests(defaultdeployments);preview_hosts: at least one preview host pattern, see Preview host patterns;suite_ids: suites whose tests run, besides anytest_ids; both empty means every recorded test;check_name: at most 100 characters, defaultFlowQA: <project name>, kept when the project is renamed;required:truemakes a run that did not happen fail the check (defaultfalse);fork_prs:approval(default) ornever;skip_drafts: defaulttrue;comment_screenshots:auto(default, private repositories only),onoroff;preview_bypass:{ "header", "value" }or null; write only, so the view answers{ "header", "set": true };combination_ids: the hook's browsers, empty for the project's defaults; at least one must be Chromium;use_deployment_urlmust staytrue.
curl -sS -X POST "$SNAG_API/v1/projects/$PROJECT_ID/qa/github-hooks" -H "Authorization: Bearer $SNAG_SESSION_TOKEN" -H 'content-type: application/json' \
-d '{"name":"Pull requests","repo":"acme/shop","github_environment":"Preview","environment":"preview","mode":"pull_requests","preview_hosts":["*-acme.vercel.app"],"required":true,"preview_bypass":{"header":"x-vercel-protection-bypass","value":"'"$VERCEL_BYPASS_SECRET"'"}}'
{ "hook_id": "qtr_...", "project_id": "prj_...", "name": "Pull requests", "repo": "acme/shop", "github_environment": "Preview", "environment": "preview",
"test_ids": [], "combination_ids": [], "use_deployment_url": true,
"mode": "pull_requests", "suite_ids": [], "preview_hosts": ["*-acme.vercel.app"],
"preview_host_warnings": [{ "pattern": "*-acme.vercel.app", "warning": "Anyone can create a project named like this on vercel.app; TestFinch also checks the deployment came from the host." }],
"check_name": "FlowQA: Shop", "required": true, "fork_prs": "approval", "skip_drafts": true, "comment_screenshots": "auto",
"preview_bypass": { "header": "x-vercel-protection-bypass", "set": true },
"alert_emails": ["you@company.com"], "alert_slack_channel": null, "alert_on": "failure",
"created_by": "usr_...", "last_delivery_at": null, "last_execution_id": null, "last_error": null, "revoked_at": null, "created_at": "2026-10-22T09:00:00.000Z" }
Before the installation accepts the new permissions, the same request answers a validation error whose error.details carries missing and accept_url.
Describe preview host patterns before saving, with any token that can read the project:
curl -sS -X POST "$SNAG_API/v1/projects/$PROJECT_ID/qa/github-hooks/preview-hosts" -H "Authorization: Bearer $SNAG_TOKEN" -H 'content-type: application/json' \
-d '{"preview_hosts":["*.preview.acme.com","*.vercel.app"]}'
{ "preview_hosts": [
{ "input": "*.preview.acme.com", "pattern": "*.preview.acme.com", "warning": null, "error": null },
{ "input": "*.vercel.app", "pattern": null, "warning": null, "error": "\"*.vercel.app\" covers a whole public suffix; name your own domain or a fixed part of the label, such as *-acme.vercel.app." } ] }
It checks the patterns only and looks nothing up in DNS.
Read a hook's recent pull request runs, newest first (limit 1 to 100, default 20):
curl -sS "$SNAG_API/v1/projects/$PROJECT_ID/qa/github-hooks/$HOOK_ID/pr-runs?limit=5" -H "Authorization: Bearer $SNAG_TOKEN"
{ "pr_runs": [
{ "pr_run_id": "...", "pr_numbers": [42], "pr_urls": ["https://github.com/acme/shop/pull/42"], "sha": "a1b2c3d...", "attempt": 1, "state": "done", "reason": null,
"conclusion": "failure", "preview_url": "https://shop-git-feat-x-acme.vercel.app", "approved_by": null, "test_count": 43,
"created_at": "2026-10-22T09:00:00.000Z", "started_at": "2026-10-22T09:01:00.000Z", "finished_at": "2026-10-22T09:04:00.000Z",
"executions": [{ "execution_id": "qex_...", "status": "completed" }] } ] }
state is one of waiting, pending, awaiting_approval, running, done, refused, capped, superseded and cancelled, with reason saying why a run did not happen.
A run started by a pull request hook also carries pull_request: { repo, number, url } in its run view.
Workspace admins, signed in as themselves, read every repository's pull request use with GET /v1/integrations/github/repos?workspace_id= and set a cap with PUT /v1/integrations/github/repos/:owner/:name/policy, body { "workspace_id": "...", "pr_monthly_test_runs": 1000 }, where null goes back to the plan default.
Over MCP the same operations are the tool flowqa_github_hook with action list, create, delete or pr_runs; flowqa_get_run reads a run.
create takes the pull request fields above (mode, preview_hosts, suite_ids, check_name, required, fork_prs, skip_drafts, comment_screenshots, preview_bypass), and pr_runs needs hook_id and takes limit (default 10).