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
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,13 +101,70 @@ 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">Currently, classic and fine-grained access tokens are supported only. Alternative token types like OAuth access tokens (for example, OAuth apps) are not supported.</Callout>
111
+
112
+
#### Personal Access Token
113
+
114
+
Personal access tokens will have access to all repositories 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
+
120
+
-`repo`
121
+
-`read:org`
122
+
-`user:email`
123
+
-`read:discussion`
124
+
-`workflow`
125
+
126
+
#### Fine-Grained Access Token
127
+
128
+
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 you have access to.
129
+
130
+
In contrast to personal access tokens, fine-grained access tokens for organization resources may be restricted, may have an expiration, and may require approval.
131
+
132
+
-**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
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
+
-**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
135
+
136
+
Start by navigating to create a [new fine-grained access token](https://github.com/settings/personal-access-tokens/new).
137
+
138
+
Pick the resource owner that owns the repositories you want to use with Batch Changes. This will likely be your company's GitHub organization.
139
+
140
+

141
+
142
+
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 you may have to generate a new token when you want to handle a new repository with Batch Changes.
143
+
144
+

145
+
146
+
Under "Permissions," click on the arrows on the right-hand side to expand the list of repository and organization permissions.
147
+
148
+

149
+
150
+
Under "Repository permissions", select the following permissions:
151
+
152
+
- Contents: Read and write
153
+
- Metadata: Read-only
154
+
- Pull requests: Read and write
155
+
- Workflows: Read and write
156
+
157
+
Under "Organization permissions", select the following permissions:
158
+
159
+
- Custom properties: Read-only
160
+
161
+
Once you created the token, copy it and add it to your Batch Changes credentials.
162
+
163
+

164
+
165
+
If your organization requires approval for fine-grained access tokens, you must wait for an administrator to approve the token before you can publish changesets with it.
166
+
167
+
The fine-grained access token is now ready to use. Create a new batch change to start using it.
111
168
112
169
### GitHub Enterprise
113
170
@@ -129,7 +186,7 @@ When working with organizations that have SAML SSO (Single Sign On) enabled, con
129
186
130
187
<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
188
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>
189
+
<Callouttype="info">Currently, classic personal and fine-grained access tokens are supported only. Alternative token types like OAuth access tokens (for example, OAuth apps) are not supported.</Callout>
133
190
134
191
### GitLab
135
192
@@ -239,4 +296,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.
299
+
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