You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/batch-changes/configuring-credentials.mdx
+62-4Lines changed: 62 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,13 +101,71 @@ Let's learn how you can do it for different code hosts.
101
101
102
102
### GitHub
103
103
104
-
On GitHub.com, [create a personal access token (classic) with the correct scopes](https://github.com/settings/tokens/new?scopes=repo,read:org,user:email,read:discussion,workflow).
104
+
On GitHub.com, create a personal access token or fine-grained access token with the correct scopes.
105
105
106
106
The `workflow` scope is technically only required if your batch changes modify files in the `.github` directory of a repository. Still, it's recommended to enable it regardless to avoid confusing errors at a later time.
107
107
108
108
When working with organizations that have SAML SSO (Single Sign On) enabled, configuring credentials requires an additional step that [involves white-listing the token for use in that organization](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
109
109
110
-
<Callouttype="info">At present, only classic personal access tokens (PATs) are supported. Alternative token types like OAuth access tokens (e.g., OAuth apps), and fine-grained personal access tokens (PATv2) are not supported.</Callout>
110
+
<Callouttype="info">At present, only classic and fine-grained access tokens are supported. Alternative token types like OAuth access tokens (e.g. OAuth apps) are not supported.</Callout>
111
+
112
+
#### Personal Access Token
113
+
114
+
Personal access tokens will have access to all repositories that you have access to.
115
+
116
+
[Click here to prefill the form](https://github.com/settings/tokens/new?scopes=repo,read:org,user:email,read:discussion,workflow).
117
+
118
+
Required Scopes:
119
+
-`repo`
120
+
-`read:org`
121
+
-`user:email`
122
+
-`read:discussion`
123
+
-`workflow`
124
+
125
+
#### Fine-Grained Access Token
126
+
127
+
Fine-grained access tokens allow more granular control of what actions can be performed for a given set of repositories. Most notably, fine-grained access tokens don't grant access by default to all repositories that you have access to.
128
+
129
+
In contrast to personal access tokens, fine-grained access tokens for organization resources may be restricted, may have an expiration, and may require approval.
130
+
131
+
**Restriction**: If an administrator of your GitHub organization has restricted access via fine-grained access tokens, you may not be able to use them for Batch Changes.
132
+
133
+
**Expiration**: If your organization has configured fine-grained access tokens to have maximum lifetimes, you may need to recreate the token when it has expired.
134
+
135
+
**Approval**: If your organization has configured fine-grained access tokens to require approval, you may need to wait for an administrator to approve the token before you can use it with Batch Changes.
136
+
137
+
Start by navigating to the form for creating a [new fine-grained access token](https://github.com/settings/personal-access-tokens/new).
138
+
139
+
Pick the resource owner that owns the repositories you want to use with Batch Changes. This will most likely be your company's GitHub organization.
140
+
141
+
PICTURE
142
+
143
+
Scroll down and select "All repositories" so that your token can access all current and future repositories that you have access to. You may restrict it to "Only select repositories", but may have to generate a new token when you want to handle a new repository with Batch Changes.
144
+
145
+
PICTURE
146
+
147
+
Under "Permissions" click on the arrows on the right-hand side to expand the list for repository and organization permissions.
148
+
149
+
PICTURE
150
+
151
+
Under "Repository permissions", select the following permissions:
152
+
- Commit statuses: Read-only
153
+
- Contents: Read and write
154
+
- Discussions: Read-only
155
+
- Metadata: Read-only
156
+
- Pull requests: Read and write
157
+
- Workflows: Read and write
158
+
159
+
Under "Organization permissions", select the following permissions:
160
+
- Custom properties: Read-only
161
+
162
+
Once you created the token, copy it and add it to your Batch Changes credentials.
163
+
164
+
If your organization requires approval for fine-grained access tokens, you need to wait for an administrator to approve the token.
165
+
166
+
PICTURE
167
+
168
+
TODO: Rest of text
111
169
112
170
### GitHub Enterprise
113
171
@@ -129,7 +187,7 @@ When working with organizations that have SAML SSO (Single Sign On) enabled, con
129
187
130
188
<Callouttype="warning">Currently, for customers on an instance of GitHub Enterprise Cloud that uses [SSH certificate authorities](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities) and requires SSH certificates to authenticate, we are unable to provide a means of authenticating Batch Changes to your code host.</Callout>
131
189
132
-
<Callouttype="info">At present, only classic personal access tokens (PATs) are supported. Alternative token types like OAuth access tokens (e.g. OAuth apps), and fine-grained personal access tokens (PATv2) are not supported.</Callout>
190
+
<Callouttype="info">At present, only classic personal and fine-grained access tokens are supported. Alternative token types like OAuth access tokens (e.g. OAuth apps) are not supported.</Callout>
133
191
134
192
### GitLab
135
193
@@ -239,4 +297,4 @@ To remove a GitHub app from your Sourcegraph instance, navigate back to the same
If you want to delete the GitHub app entirely you have to navigate to [GitHub's list of applications](https://github.com/settings/apps/), and delete it from there.
300
+
If you want to delete the GitHub app entirely you have to navigate to [GitHub's list of applications](https://github.com/settings/apps/), and delete it from there.
0 commit comments