Fix repository URL handling in PublicGitRepository.php and public-git-repository.blade.php

This commit is contained in:
Andras Bacsai 2024-04-29 13:43:45 +02:00
parent 16278f36ec
commit 57d67bc4a8
2 changed files with 8 additions and 4 deletions

View File

@ -94,6 +94,13 @@ public function load_branch()
$repository = str($this->repository_url)->after(':')->before('.git');
$this->repository_url = 'https://' . str($github_instance) . '/' . $repository;
}
if (
(str($this->repository_url)->startsWith('https://') ||
str($this->repository_url)->startsWith('http://')) &&
!str($this->repository_url)->endsWith('.git')
) {
$this->repository_url = $this->repository_url . '.git';
}
} catch (\Throwable $e) {
return handleError($e, $this);
}
@ -192,9 +199,6 @@ public function submit()
'build_pack' => $this->build_pack,
];
}
if ($this->build_pack === 'dockerfile' || $this->build_pack === 'dockerimage' || $this->application->dockerfile) {
$application_init['health_check_enabled'] = false;
}
$application = Application::create($application_init);

View File

@ -3,7 +3,7 @@
<div class="pb-4">Deploy any public Git repositories.</div>
<form class="flex flex-col gap-2" wire:submit='load_branch'>
<div class="flex flex-col gap-2">
<div class="flex flex-col">
<div class="flex flex-col gap-2">
<div class="flex items-end gap-2">
<x-forms.input required id="repository_url" label="Repository URL (https://)" helper="{!! __('repository.url') !!}" />
<x-forms.button type="submit">