Skip to content

Commit 3cdd4be

Browse files
authored
feature KnpLabs#1062 Fix issue KnpLabs#1061 (mruell)
This PR was squashed before being merged into the 3.4.x-dev branch. Discussion ---------- Commits ------- bc93867 Boolean private needed to create private repo as seen in: https://docs.github.com/en/rest/reference/repos#create-an-organization-repository a1f9686 Fix tests 74a46ee Merge branch 'KnpLabs:master' into master 11d92e7 Fix issue d2780b5 Fix tests
1 parent fe08020 commit 3cdd4be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Github/Api/Repo.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,17 @@ public function create(
206206
'description' => $description,
207207
'homepage' => $homepage,
208208
'private' => ($visibility ?? ($public ? 'public' : 'private')) === 'private',
209-
'visibility' => $visibility ?? ($public ? 'public' : 'private'),
210209
'has_issues' => $hasIssues,
211210
'has_wiki' => $hasWiki,
212211
'has_downloads' => $hasDownloads,
213212
'auto_init' => $autoInit,
214213
'has_projects' => $hasProjects,
215214
];
216215

216+
if ($visibility) {
217+
$parameters['visibility'] = $visibility;
218+
}
219+
217220
if ($organization && $teamId) {
218221
$parameters['team_id'] = $teamId;
219222
}

test/Github/Tests/Api/RepoTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ public function shouldCreateRepositoryUsingNameOnly()
9595
'name' => 'l3l0Repo',
9696
'description' => '',
9797
'homepage' => '',
98-
'visibility' => 'public',
9998
'private' => false,
10099
'has_issues' => false,
101100
'has_wiki' => false,
@@ -122,7 +121,6 @@ public function shouldCreateRepositoryForOrganization()
122121
'name' => 'KnpLabsRepo',
123122
'description' => '',
124123
'homepage' => '',
125-
'visibility' => 'public',
126124
'private' => false,
127125
'has_issues' => false,
128126
'has_wiki' => false,
@@ -374,7 +372,6 @@ public function shouldCreateUsingAllParams()
374372
'name' => 'l3l0Repo',
375373
'description' => 'test',
376374
'homepage' => 'http://l3l0.eu',
377-
'visibility' => 'private',
378375
'private' => true,
379376
'has_issues' => false,
380377
'has_wiki' => false,

0 commit comments

Comments
 (0)