feat: installation/update github apps

This commit is contained in:
Andras Bacsai
2023-05-09 11:33:50 +02:00
parent db92dc3636
commit 19ad184cd6
20 changed files with 179 additions and 35 deletions

View File

@@ -85,16 +85,20 @@ Route::middleware(['auth'])->group(function () {
Route::middleware(['auth'])->group(function () {
Route::get('/source/new', fn () => view('source.new'))->name('source.new');
Route::get('/source/github/{github_app_uuid}', function (Request $request) {
$github_app = GithubApp::where('uuid', request()->github_app_uuid)->first();
$name = Str::kebab('coolify' . $github_app->name);
$settings = InstanceSettings::first();
$host = $request->schemeAndHttpHost();
if ($settings->fqdn) {
$host = $settings->fqdn;
}
$github_app = GithubApp::where('uuid', request()->github_app_uuid)->first();
$installation_path = $github_app->html_url === 'https://github.com' ? 'apps' : 'github-apps';
$installation_url = "$github_app->html_url/$installation_path/$name/installations/new";
return view('source.github.show', [
'github_app' => $github_app,
'host' => $host,
'name' => Str::kebab('coolify' . $github_app->name)
'name' => $name,
'installation_url' => $installation_url,
]);
})->name('source.github.show');
});