Fix repository URL handling in PublicGitRepository.php
This commit is contained in:
parent
a00b5aa136
commit
b16109ca56
@ -89,9 +89,11 @@ class PublicGitRepository extends Component
|
|||||||
public function load_branch()
|
public function load_branch()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->validate([
|
if (str($this->repository_url)->startsWith('git@')) {
|
||||||
'repository_url' => 'required|url'
|
$github_instance = str($this->repository_url)->after('git@')->before(':');
|
||||||
]);
|
$repository = str($this->repository_url)->after(':')->before('.git');
|
||||||
|
$this->repository_url = 'https://' . str($github_instance) . '/' . $repository;
|
||||||
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user