GitHub
connect_github, list_github_repos, link_repo, deploy_from_repo and unlink_repo — building an app from a repository instead of from source you hand over.
Connect a customer's GitHub repository to an app and every push to the chosen branch deploys. For the task-shaped version, see Deploying from GitHub.
These tools are for apps that run code. A static site cannot be linked to a repository — it has no
build step — so deploy its files with deploy_app.
connect_github
Start connecting a GitHub account. Takes no parameters.
Returns a link the customer opens in a browser, where they install the agenthost app on their account or organization and choose which repositories it may read. GitHub then returns them to agenthost, which asks them to sign in with the email on their account: that is what says the repositories belong to this account rather than to whoever handed them a link. You cannot do either part for them, and agenthost never asks for a GitHub password or token.
Safe to call at any time: it also reports which GitHub accounts are already connected, and the same link adds repositories to an existing installation.
list_github_repos
The repositories agenthost can read for this customer. Takes no parameters.
Each entry carries its default_branch, which is what link_repo uses unless you say otherwise. A
repository the customer expected but does not see was not selected during installation — call
connect_github and have them open the link to add it.
link_repo
Build an app from a repository. Deploys once immediately unless deploy is false.
| Parameter | Type | Description |
|---|---|---|
service_id | uuid, required | App to build from the repository. |
repo | string, required | "owner/name". A github.com URL is accepted too. |
branch | string | Branch to deploy from. Defaults to the repository's default branch. |
auto_deploy | boolean | Deploy when that branch is pushed. Defaults to true. |
deploy | boolean | Deploy as part of linking. Defaults to true. |
Call it again on the same app to change the branch or turn auto-deploy off — it replaces the link rather than adding a second one. There is no separate tool for editing what this one sets.
Builds are asynchronous
A successful call means the build is queued. Poll get_app until the
status settles, then confirm with a real request.
deploy_from_repo
Deploy the connected repository now — the manual counterpart to deploying on push, and the way to
ship when auto_deploy is off.
| Parameter | Type | Description |
|---|---|---|
service_id | uuid, required | App (service) id. |
ref | string | Branch, tag or commit to deploy. Defaults to the connected branch. |
Deploying costs nothing, whatever the source.
unlink_repo
Stop building an app from its repository.
| Parameter | Type | Description |
|---|---|---|
service_id | uuid, required | App (service) id. |
The app keeps running exactly what it last deployed, along with its URL, environment variables and
databases. Only future pushes stop mattering; deploy_app takes over again. Nothing is changed on
GitHub — the customer revokes agenthost's access from their own GitHub settings.
Seeing the connection
get_app and list_apps include a
source for a connected app: the repository, the branch, whether pushes deploy, and the last commit
that shipped. An app with no source is deployed by hand.