Skip to main content
Sourcebot can sync code from GitHub.com, GitHub Enterprise Server, and GitHub Enterprise Cloud. If you’re not familiar with Sourcebot connections, please read that overview first.

Examples

Authenticating with GitHub

In order to index private repositories, you’ll need to generate a access token and provide it to Sourcebot. GitHub provides two types of access tokens:

Fine-grained personal access tokens

Create a new fine-grained PAT here. First, select the resource owner and the repositories that you want Sourcebot to have access to.Next, under “Repository permissions”, select permissions Contents and Metadata with access Read-only. The permissions should look like the following:GitHub PAT ScopeGitHub docs
Create a new PAT here and make sure you select the repo scope:GitHub PAT ScopeGitHub docs
Next, provide the access token via the token property, either as an environment variable or a secret:
  1. Add the token property to your connection config:
  1. Pass this environment variable each time you run Sourcebot:

Connecting to a custom GitHub host

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

Schema reference

schemas/v3/github.json