mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
docs: Add instructions for using GitHub fine grained PATs (#384)
This commit is contained in:
parent
9b13492cb3
commit
55c8e41137
2 changed files with 21 additions and 3 deletions
|
|
@ -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:
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
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 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 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">
|
||||||
|
|
|
||||||
BIN
docs/images/github_pat_scopes_fine_grained.png
Normal file
BIN
docs/images/github_pat_scopes_fine_grained.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Loading…
Reference in a new issue