Skip to content

Commit 517abf6

Browse files
authored
Change GitLab access token scope GLVSC-601
* rename placeholder text * pre-fill scopes for GitLab access token * add note to CHANGELOG
1 parent 5e24602 commit 517abf6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- GitLab & GitLab self-managed access tokens now require `api` scope instead of `read_api` to be able to merge Pull Requests.
12+
913
## [15.2.0] - 2024-07-10
1014

1115
### Added

src/plus/integrations/authentication/gitlab.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ export class GitLabAuthenticationProvider extends LocalIntegrationAuthentication
5959
input.placeholder = `Requires ${descriptor?.scopes.join(', ') ?? 'all'} scopes`;
6060
input.prompt = `Paste your [GitLab Personal Access Token](https://${
6161
descriptor?.domain ?? 'gitlab.com'
62-
}/-/profile/personal_access_tokens "Get your GitLab Access Token")`;
62+
}/-/user_settings/personal_access_tokens?name=GitLens+Access+token&scopes=${
63+
descriptor?.scopes.join(',') ?? 'all'
64+
} "Get your GitLab Access Token")`;
6365
input.buttons = [infoButton];
6466

6567
input.show();

src/plus/integrations/providers/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export const providersMetadata: ProvidersMetadata = {
376376
],
377377
// Use 'username' property on account for issue filters
378378
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
379-
scopes: ['read_api', 'read_user', 'read_repository'],
379+
scopes: ['api', 'read_user', 'read_repository'],
380380
},
381381
[SelfHostedIntegrationId.GitLabSelfHosted]: {
382382
domain: '',
@@ -391,7 +391,7 @@ export const providersMetadata: ProvidersMetadata = {
391391
],
392392
// Use 'username' property on account for issue filters
393393
supportedIssueFilters: [IssueFilter.Author, IssueFilter.Assignee],
394-
scopes: ['read_api', 'read_user', 'read_repository'],
394+
scopes: ['api', 'read_user', 'read_repository'],
395395
},
396396
[HostingIntegrationId.Bitbucket]: {
397397
domain: 'bitbucket.org',

0 commit comments

Comments
 (0)