Add manual Git webhooks and migration files

This commit is contained in:
Andras Bacsai
2023-11-14 13:26:14 +01:00
parent 45fa88ca4d
commit 8db66952e8
9 changed files with 383 additions and 10 deletions

View File

@@ -50,8 +50,11 @@ function generate_github_jwt_token(GithubApp $source)
return $issuedToken;
}
function githubApi(GithubApp|GitlabApp $source, string $endpoint, string $method = 'get', array|null $data = null, bool $throwError = true)
function githubApi(GithubApp|GitlabApp|null $source, string $endpoint, string $method = 'get', array|null $data = null, bool $throwError = true)
{
if (is_null($source)) {
throw new \Exception('Not implemented yet.');
}
if ($source->getMorphClass() == 'App\Models\GithubApp') {
if ($source->is_public) {
$response = Http::github($source->api_url)->$method($endpoint);