Sourcebot can sync code from GitHub.com, GitHub Enterprise Server, and GitHub Enterprise Cloud.

Examples

Authenticating with GitHub

In order to index private repositories, you’ll need to generate a GitHub Personal Access Token (PAT). Create a new PAT here and make sure you select the repo scope:

Next, provide the PAT via the token property, either as an environment variable or a secret:

Environment variables are only supported in a declarative config and cannot be used in the web UI.
  1. Add the token property to your connection config:
{
    "type": "github",
    "token": {
        // note: this env var can be named anything. It
        // doesn't need to be `GITHUB_TOKEN`.
        "env": "GITHUB_TOKEN"
    }
    // .. rest of config ..
}
  1. Pass this environment variable each time you run Sourcebot:
docker run \
    -e GITHUB_TOKEN=<PAT> \
    /* additional args */ \
    ghcr.io/sourcebot-dev/sourcebot:latest

Connecting to a custom GitHub host

To connect to a GitHub host other than github.com, provide the url property to your config:

{
    "type": "github",
    "url": "https://github.example.com"
    // .. rest of config ..
}

Schema reference