1
0
Fork 0

GitLab: detect repository functionality disabled in Driver (#10440)

pull/10432/head
Stephan 2022-01-06 14:06:38 +00:00 committed by GitHub
parent cb41ad1d4b
commit 9360e2c18a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -504,6 +504,11 @@ class GitLabDriver extends VcsDriver
// force auth as the unauthenticated version of the API is broken // force auth as the unauthenticated version of the API is broken
if (!isset($json['default_branch'])) { if (!isset($json['default_branch'])) {
// GitLab allows you to disable the repository inside a project to use a project only for issues and wiki
if (isset($json['repository_access_level']) && $json['repository_access_level'] === 'disabled') {
throw new TransportException('The GitLab repository is disabled in the project', 400);
}
if (!empty($json['id'])) { if (!empty($json['id'])) {
$this->isPrivate = false; $this->isPrivate = false;
} }