Link a GitHub repository
Bind a repository to this function so every push to branch deploys it. A function holds at most one link; linking again returns 400.
The server decides how the link authenticates. If the project has the Zavu GitHub App installed, the link uses that installation: private repositories work and there is nothing to configure in the repository. Otherwise it falls back to a manual link and the response carries a webhookSecret you add to the repository yourself. connection says which one you got.
The repository is not checked against GitHub here, because it cannot be: an owner/repo that does not exist, or that the installation cannot see, is accepted and fails on the first deploy with a fetch error.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
functionIdstringrequiredZavu Function ID.
Body
application/json
ownerstringrequiredrepostringrequiredbranchstringDefaultmainrootDirstringSubdirectory holding the project, for monorepos.
autoDeploybooleanDefaulttrue
Responses
201Link created. The only response that ever carries `webhookSecret`.
linkobjectrequiredA GitHub repository bound to a function. A push to
branchdeploys the function. A function holds at most one link.16 properties
idstringrequiredfunctionIdstringrequiredproviderstringrequiredOne ofgithubownerstringrequiredrepostringrequiredbranchstringrequiredOnly pushes to this branch deploy.
rootDirstringSubdirectory holding the project, for monorepos. Null when the project is at the repository root.
autoDeploybooleanrequiredWhen false the link is kept and pushes are ignored.
connectionstringrequiredHow this link authenticates, decided by the server rather than by the caller. -
app: the Zavu GitHub App is installed on the account. Pushes arrive on the app's webhook and private repositories work. Nothing to configure in the repository. -manual: no installation. The link carries its own secret and you add the webhook to the repository yourself.One ofappmanuallastStatusstringOne ofdeployingdeployedfailednulllastCommitShastringlastCommitMessagestringlastErrorstringWhy the last deploy failed. Null otherwise.
lastDeployAtstring<date-time>createdAtstring<date-time>requiredupdatedAtstring<date-time>required
webhookUrlstring<uri>requiredEndpoint that receives GitHub's push deliveries. Only needed on a
manuallink, where you add it to the repository yourself.webhookSecretstringShared secret for the repository's webhook. Returned only when creating a
manuallink, and only there — every later read strips it, and re-linking mints a new one. Absent entirely on anapplink, which needs no secret of its own.
400Invalid owner, repo or branch, or the function is already linked.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Function not found.
codestringrequiredmessagestringrequireddetailsobject