From d28cf0b76d2e1177bed65e3e7f4d6170878c332e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 28 Aug 2023 21:03:07 +0200 Subject: [PATCH] fix: webhook endpoint in cloud and no system wide gh app --- app/Http/Livewire/Source/Github/Change.php | 8 +++- .../livewire/source/github/change.blade.php | 38 ++++++++++--------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/app/Http/Livewire/Source/Github/Change.php b/app/Http/Livewire/Source/Github/Change.php index e2be4e0ab..859e94f79 100644 --- a/app/Http/Livewire/Source/Github/Change.php +++ b/app/Http/Livewire/Source/Github/Change.php @@ -37,9 +37,13 @@ class Change extends Component public function mount() { - $this->webhook_endpoint = $this->ipv4; + if (is_cloud()) { + $this->webhook_endpoint = config('app.url'); + } else { + $this->webhook_endpoint = $this->ipv4; + $this->is_system_wide = $this->github_app->is_system_wide; + } $this->parameters = get_route_parameters(); - $this->is_system_wide = $this->github_app->is_system_wide; } public function submit() diff --git a/resources/views/livewire/source/github/change.blade.php b/resources/views/livewire/source/github/change.blade.php index 1fc17d985..737bdac42 100644 --- a/resources/views/livewire/source/github/change.blade.php +++ b/resources/views/livewire/source/github/change.blade.php @@ -77,20 +77,22 @@
You need to register a GitHub App before using this source.
-
- - @if ($ipv4) - - @endif - @if ($ipv6) - - @endif - @if ($fqdn) - - @endif - -
+ @if (!is_cloud()) +
+ + @if ($ipv4) + + @endif + @if ($ipv6) + + @endif + @if ($fqdn) + + @endif + +
+ @endif
@@ -118,9 +120,11 @@ @endif
- + @if (!is_cloud()) + + @endif