Skip to content

Commit 55c8e41

Browse files
docs: Add instructions for using GitHub fine grained PATs (#384)
1 parent 9b13492 commit 55c8e41

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

docs/docs/connections/github.mdx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,29 @@ Sourcebot can sync code from GitHub.com, GitHub Enterprise Server, and GitHub En
104104

105105
## Authenticating with GitHub
106106

107-
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:
107+
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:
108108

109-
![GitHub PAT Scope](/images/github_pat_scopes.png)
110109

111-
Next, provide the PAT via the `token` property, either as an environment variable or a secret:
110+
<AccordionGroup>
111+
<Accordion title="Fine-grained personal access tokens" defaultOpen>
112+
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.
113+
114+
Next, under "Repository permissions", select permissions `Contents` and `Metadata` with access `Read-only`. The permissions should look like the following:
115+
116+
![GitHub PAT Scope](/images/github_pat_scopes_fine_grained.png)
117+
118+
[GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens)
119+
</Accordion>
120+
<Accordion title="Personal access tokens (classic)">
121+
Create a new PAT [here](https://github.com/settings/tokens/new) and make sure you select the `repo` scope:
122+
123+
![GitHub PAT Scope](/images/github_pat_scopes.png)
124+
125+
[GitHub docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic)
126+
</Accordion>
127+
</AccordionGroup>
128+
129+
Next, provide the access token via the `token` property, either as an environment variable or a secret:
112130

113131
<Tabs>
114132
<Tab title="Environment Variable">
22.9 KB
Loading

0 commit comments

Comments
 (0)