vcs.createRepository()

This commit is contained in:
Matej Bačo committed 2023-06-18 13:38:37 +02:00
1 parent 860b4fb1c0
commit a174562c4e
6 files changed
+196 -52

No files matched your search

+11
View File
@@ -208,4 +208,15 @@ class Github extends OAuth2
return $this->user;
}
public function createRepository(string $accessToken, string $repositoryName, bool $private): array
{
$repository = $this->request('POST', 'https://api.github.com/user/repos', ['Authorization: token ' . \urlencode($accessToken)], \json_encode([
'name' => $repositoryName,
'private' => $private
]));
$repository = \json_decode($repository, true);
return $repository;
}
}