Skip to content

Commit de92500

Browse files
authored
bug #1030 Add accept header for creating repo from template (davidpeach)
This PR was squashed before being merged into the 3.4.x-dev branch. Discussion ---------- This still requires an accept header as per the docs: https://docs.github.com/en/rest/reference/repos#create-a-repository-using-a-template-preview-notices Commits ------- 34e3370 Add accept header for creating repo from template 91b3911 Update Repo.php
1 parent 14077dc commit de92500

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,9 @@ public function transfer($username, $repository, $newOwner, $teamId = [])
805805
*/
806806
public function createFromTemplate(string $templateOwner, string $templateRepo, array $parameters = [])
807807
{
808+
//This api is in preview mode, so set the correct accept-header
809+
$this->acceptHeaderValue = 'application/vnd.github.baptiste-preview+json';
810+
808811
return $this->post('/repos/'.rawurldecode($templateOwner).'/'.rawurldecode($templateRepo).'/generate', $parameters);
809812
}
810813
}

0 commit comments

Comments
 (0)