Connecting GitHub
A connector lets a GitHub repository tell Cairn what happened to the work: a pull request opened, a review approved, CI passed, a deploy succeeded. Cairn turns those into Deliverables and Evidence on the Mission the work belongs to.
This page takes a repository from nothing to a pull request appearing in your Review Queue. It takes about ten minutes and needs an admin in Cairn, an owner to approve, and admin access to the repository on GitHub.
What a connector is
A connector is inbound only. GitHub posts to Cairn; Cairn never calls GitHub. There is no GitHub token to hand over and nothing to install. Cairn generates a signing secret, and you paste it into the repository's webhook settings.
Two properties to know before you start:
- Reach is listed, never implied. A connector accepts deliveries about exactly the repositories you name. There is no "all repositories" option.
- Every delivery is signed. Cairn computes
HMAC-SHA256over the exact bytes of the request body and compares it with GitHub's signature header. A delivery that fails the check is rejected and nothing is recorded from it.
Your plan sets how many connectors a workspace can have.
1 · Link the connector in Cairn
Open Connectors, choose GitHub, give the connector a name, and list the
repositories it may hear from as owner/name, one per line or comma-separated.
Linking a connector is a Level-5 action, so it always needs an explicit approval, even when an owner is the one asking. What happens next depends on who you are:
- Owner: Cairn asks you to confirm the repositories it will reach. Click Approve and link.
- Admin: the request waits for an owner, in their Attention Inbox. Once they approve it, the request on your Connectors page changes to Approved — ready to link. Click Finish linking. There is nothing to fill in again, and Cairn links exactly the repositories that were approved.
Cairn then shows the webhook URL and a signing secret, once. The secret is stored encrypted and no screen shows it again. If you lose it, rotate it to get a new one.
2 · Point GitHub at Cairn
In the repository: Settings → Webhooks → Add webhook.
| Field | Value |
|---|---|
| Payload URL | the URL Cairn showed you, ending /api/connectors/…/webhook |
| Content type | application/json |
| Secret | the secret Cairn showed once |
| SSL verification | Enable |
| Events | Let me select individual events, then the five below |
Content type is the one to get right. GitHub defaults to
application/x-www-form-urlencoded, which Cairn cannot read. A hook with the
right secret and the wrong content type fails every time.
The five events
pull_request · pull_request_review · check_suite · workflow_run ·
deployment_status
Anything else is accepted and ignored, so subscribing to more only adds noise. Leave Pushes unchecked.
Repeat this step for each repository you listed. They all use the same URL and secret.
3 · Bind a Mission
This is the step people miss. Listing a repository lets its deliveries in. Binding gives them somewhere to land.
Open the Mission this work belongs to and set Ships in to the repository.
Without it, a correctly signed delivery is accepted and set aside, recorded as
no_mission_ships_in_this_resource. GitHub sees a 202, which looks like
success, and nothing appears in Cairn. The Attention Inbox raises it in the
Intervene lane so it does not go unnoticed.
Binding late is fine. When you set Ships in, Cairn goes back over that repository's unplaced deliveries from the last 30 days (up to 200) and processes them in order.
Bind a repository to one Mission at a time. If two Missions ship in the same repository, Cairn cannot tell which one a pull request belongs to and records the delivery as ambiguous instead of guessing.
4 · Check it works
- GitHub's Recent Deliveries tab shows a
202response. - Cairn's Connectors page shows "last delivery" with a recent time.
- Open a pull request. It appears in the Review Queue badged "from GitHub", and a committed Mission moves to Reviewable.
What GitHub events become
| GitHub | Cairn | Verifying? |
|---|---|---|
| PR opened / reopened / ready | a Deliverable in the Review Queue | — |
| PR merged | Evidence (pr) |
yes |
| PR closed unmerged | Evidence (pr) |
no |
| Review approved | Evidence (approval) |
yes |
| Changes requested | Evidence (approval) |
no |
| Check suite / workflow run completed | Evidence (ci) |
only when green |
| Deployment succeeded / failed | Evidence (deploy) |
only on success |
GitHub evidence takes a Mission as far as Reviewable. It does not make a Mission Verified, because a green build does not say which acceptance condition it satisfied. A person attaches or confirms evidence against each condition.
When something is wrong
Every delivery returns 401
The signature did not verify. In order of likelihood:
- The secret does not match. Rotate it in Cairn and paste the new one into GitHub.
- The content type is form-encoded. Set it to
application/json.
The Connectors page shows a count of rejected deliveries when this is happening.
Deliveries return 202 but nothing appears
Almost always the missing Mission binding from step 3. Check the Intervene
lane of the Attention Inbox. The other cause is a hook on a repository the
connector does not list: that delivery is recorded as resource_not_allowed
and ignored.
Deliveries return 404
The connector id in the Payload URL is wrong, or the connector has been disabled. Copy the URL again from the Connectors page, or enable the connector.
Deliveries return 413
The payload is larger than 1 MB. Cairn refuses those without reading them.
Rotating the secret
Connectors → Rotate secret. Like linking, rotation is Level 5: the first attempt raises a Checkpoint, an owner approves it in the Inbox, and you rotate again. The old secret stops working immediately, so deliveries fail until the new one is pasted into GitHub. Do the two together.
Turning a connector off
Disable stops deliveries being accepted straight away. Nothing already received is lost. Enabling it again needs an owner's approval, the same as linking. Connectors are not deleted.
A GitHub App instead of a repository webhook
A repository webhook covers everything on this page. If your organization prefers GitHub Apps, you can create your own and point its webhook at Cairn: same Payload URL, same secret, no callback URL or private key. Read-only permissions are enough: Metadata, Pull requests, Checks, Actions and Deployments.
The reason to bother is that an App's "Only select repositories" installation is enforced by GitHub, so GitHub will not send Cairn anything about a repository the App was never installed on.
One constraint: a GitHub App has a single webhook URL and secret, and a connector belongs to one workspace. One App therefore maps to one Cairn workspace. Cairn does not publish a GitHub App of its own.
Other systems
The Generic webhook connector accepts a signed JSON POST from anything,
through the same checks: signature, listed resources, audit trail.
- Put the resource name in a
resourcefield. It must be one you listed. - Sign the exact bytes of the body with the connector's secret and send the
result as
X-Cairn-Signature-256: sha256=<hex digest>. - Send a unique id per event in an
X-Cairn-Deliveryheader (or anidfield) so a retry is not recorded twice.
Generic deliveries are stored and audited. Cairn derives no Deliverables or Evidence from them, because it does not know what a custom event means. GitHub is the only system it understands today.
Several Missions in one repository
When a repository has several Missions, Cairn will not guess which one owns a PR. On Connectors, expand Delivery diagnostics and PR assignment, choose the Mission, and paste its GitHub PR URL. Member+ may request this; normal actor-level and resource authorization still apply. If an approval is needed, finish the same request after approval. The PR cannot be assigned to two Missions or silently reassigned. A withdrawn PR cannot be relinked through this form.
The association is also created by the agent's existing link_pull_request tool.
Later PR, review and check events naming exactly that PR use the recorded Mission.
A check listing multiple PRs does not choose the first. Deployments and repository-wide
checks without one associated PR remain ambiguous when several Missions share the repo.
Linking from the form queues existing unmatched deliveries for replay within the existing 30-day window, at most 200 deliveries per replay request. Refresh the log to see processing results; queued does not mean already applied. Duplicate processing converges on the same deliverable and evidence records. The log shows metadata and suggested remedies, not raw untrusted webhook bodies. Admins can retry failed deliveries. Rejected signature counts remain on the connector card; rejected unauthenticated bodies never become accepted deliveries in the log.