diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php index 12fe726b450..5760a587bed 100644 --- a/lib/Github/Api/Repo.php +++ b/lib/Github/Api/Repo.php @@ -206,7 +206,6 @@ public function create( 'description' => $description, 'homepage' => $homepage, 'private' => ($visibility ?? ($public ? 'public' : 'private')) === 'private', - 'visibility' => $visibility ?? ($public ? 'public' : 'private'), 'has_issues' => $hasIssues, 'has_wiki' => $hasWiki, 'has_downloads' => $hasDownloads, @@ -214,6 +213,10 @@ public function create( 'has_projects' => $hasProjects, ]; + if ($visibility) { + $parameters['visibility'] = $visibility; + } + if ($organization && $teamId) { $parameters['team_id'] = $teamId; }