Skip to content

Commit

Permalink
feature #1062 Fix issue #1061 (mruell)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mruell authored Jun 12, 2022
1 parent fe08020 commit 3cdd4be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,17 @@ 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,
'auto_init' => $autoInit,
'has_projects' => $hasProjects,
];

if ($visibility) {
$parameters['visibility'] = $visibility;
}

if ($organization && $teamId) {
$parameters['team_id'] = $teamId;
}
Expand Down
3 changes: 0 additions & 3 deletions test/Github/Tests/Api/RepoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function shouldCreateRepositoryUsingNameOnly()
'name' => 'l3l0Repo',
'description' => '',
'homepage' => '',
'visibility' => 'public',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
Expand All @@ -122,7 +121,6 @@ public function shouldCreateRepositoryForOrganization()
'name' => 'KnpLabsRepo',
'description' => '',
'homepage' => '',
'visibility' => 'public',
'private' => false,
'has_issues' => false,
'has_wiki' => false,
Expand Down Expand Up @@ -374,7 +372,6 @@ public function shouldCreateUsingAllParams()
'name' => 'l3l0Repo',
'description' => 'test',
'homepage' => 'http://l3l0.eu',
'visibility' => 'private',
'private' => true,
'has_issues' => false,
'has_wiki' => false,
Expand Down

0 comments on commit 3cdd4be

Please sign in to comment.