Skip to main content
Each project can receive GitHub push events and run its deploy pipeline. The endpoint does not use a session. It is authenticated by an HMAC-SHA256 signature of the raw request body, made with a per-project secret. Set it up from the panel as described in Deploy and rollback, or with POST /api/projects/:id/webhook.

POST /api/webhooks/github/:id

number
required
The project ID. Must be a positive integer.
string
required
sha256=<hex HMAC-SHA256 of the raw body using the project secret>. GitHub sets it when the webhook has a secret.
string
required
push triggers a deploy, ping is acknowledged, anything else is ignored.
string
required
application/json. Form-encoded payloads are not parsed.
string
required
For push, must equal refs/heads/<project branch>. The branch defaults to main.

Processing order

1

Find the project

Invalid ID: 400. Unknown project or no secret configured: 404.
2

Verify the signature

The panel computes HMAC-SHA256 over the exact bytes it received and compares it with the header using crypto.timingSafeEqual. A missing, malformed, or wrong signature returns 401.
3

Check the event

ping returns 200. Events other than push return 200 with ignored: true.
4

Check the branch

A push to another branch returns 200 with ignored: true.
5

Deploy

If a deploy or rollback is already running for the service: 409. Otherwise the deploy starts in the background: 202.

Responses

The response is sent before the deploy finishes. GitHub’s delivery log shows 202 even if the deploy later fails. Deploy output is only streamed to open project terminals and is not written to the journal. To check a webhook deploy, keep the project terminal open, or compare last_deploy_at and current_commit in GET /api/projects afterwards.

Secret handling

  • Secrets are 32 random bytes, hex-encoded (64 characters).
  • The secret is returned once, when you generate it, with Cache-Control: no-store. GET /api/projects only shows has_webhook.
  • Generating a new secret replaces the old one immediately. Update the GitHub webhook afterwards.
  • DELETE /api/projects/:id/webhook removes the secret. Further deliveries get 404.
The webhook route sits under /api like everything else, so it also passes the same-origin check. GitHub sends no Origin header, so the check lets it through.