Skip to content
Integrations
Integrations

GitHub

Trigger AgentField reasoners from signed GitHub webhooks.

GitHub connect dialog for a signed webhook trigger

The github source verifies GitHub's X-Hub-Signature-256 header with your webhook secret and dispatches the delivery to a reasoner.

Source Surface

SurfaceValue
Source namegithub
KindHTTP webhook
SecretRequired; GitHub webhook secret from secret_env
ConfigNo per-source config
Event typeX-GitHub-Event, plus .action when the payload has an action field
IdempotencyX-GitHub-Delivery
Reasoner inputThe GitHub JSON payload as event, with trigger metadata in _meta

GitHub does not ship a separate capability node in OSS. The integration surface is the signed webhook source.

Agent Code

from agentfield import Agent, on_event

app = Agent(node_id="repo-agent")

@app.reasoner()
@on_event(
    source="github",
    types=["pull_request.opened", "pull_request.synchronize", "issues.opened"],
    secret_env="GITHUB_WEBHOOK_SECRET",
)
async def handle_github(event: dict, trigger=None):
    return {
        "event_type": trigger.event_type if trigger else None,
        "delivery": trigger.idempotency_key if trigger else None,
        "action": event.get("action"),
    }

app.run()

GitHub Setup

In the repository or organization settings, create a webhook that points at the AgentField trigger URL. Use application/json, set a webhook secret that matches GITHUB_WEBHOOK_SECRET, and choose the event families your reasoner handles.

Common event families:

  • pull_request
  • push
  • issues
  • issue_comment
  • workflow_run

When the payload includes an action, AgentField combines it with the GitHub event name. A pull_request webhook with {"action": "opened"} becomes pull_request.opened.

Dispatch Contract

At dispatch time, the target reasoner receives the normalized payload and metadata:

{
  "event": {
    "action": "opened",
    "pull_request": { "number": 42 },
    "repository": { "full_name": "Agent-Field/agentfield" }
  },
  "_meta": {
    "source": "github",
    "event_type": "pull_request.opened",
    "idempotency_key": "<X-GitHub-Delivery>"
  }
}
  • X-GitHub-Delivery becomes the idempotency key.
  • Signature verification happens before dispatch.
  • The GitHub payload is passed through as the normalized event body.