docs: Add instructions for using GitHub fine grained PATs (#384)

This commit is contained in:
Brendan Kellam 2025-07-17 12:03:13 -07:00 committed by GitHub
parent 9b13492cb3
commit 55c8e41137
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 3 deletions

View file

@ -104,11 +104,29 @@ Sourcebot can sync code from GitHub.com, GitHub Enterprise Server, and GitHub En
## Authenticating with GitHub ## 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](https://github.com/settings/tokens/new) and make sure you select the `repo` scope: In order to index private repositories, you'll need to generate a access token and provide it to Sourcebot. GitHub provides [two types](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#types-of-personal-access-tokens) of access tokens:
![GitHub PAT Scope](/images/github_pat_scopes.png)
Next, provide the PAT via the `token` property, either as an environment variable or a secret: <AccordionGroup>
<Accordion title="Fine-grained personal access tokens" defaultOpen>
Create a new fine-grained PAT [here](https://github.com/settings/personal-access-tokens/new). 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 Scope](/images/github_pat_scopes_fine_grained.png)
[GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens)
</Accordion>
<Accordion title="Personal access tokens (classic)">
Create a new PAT [here](https://github.com/settings/tokens/new) and make sure you select the `repo` scope:
![GitHub PAT Scope](/images/github_pat_scopes.png)
[GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic)
</Accordion>
</AccordionGroup>
Next, provide the access token via the `token` property, either as an environment variable or a secret:
<Tabs> <Tabs>
<Tab title="Environment Variable"> <Tab title="Environment Variable">

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB