From e4b21959325f6fd607a07e699ad7e3d9b5e4cce6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 14 Nov 2023 14:14:21 +0100 Subject: [PATCH] Fix manual Git webhook generation --- bootstrap/helpers/shared.php | 3 ++ .../project/shared/webhooks.blade.php | 46 ++++++++++--------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 1abb90ce5..a11e857ce 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -511,6 +511,9 @@ function generateDeployWebhook($resource) return $url; } function generateGitManualWebhook($resource, $type) { + if ($resource->source_id !== 0) { + return null; + } if ($resource->getMorphClass() === 'App\Models\Application') { $baseUrl = base_url(); $api = Url::fromString($baseUrl) . "/webhooks/source/$type/events/manual"; diff --git a/resources/views/livewire/project/shared/webhooks.blade.php b/resources/views/livewire/project/shared/webhooks.blade.php index 243b5dea3..c77ae3315 100644 --- a/resources/views/livewire/project/shared/webhooks.blade.php +++ b/resources/views/livewire/project/shared/webhooks.blade.php @@ -11,27 +11,31 @@

Manual Git Webhooks

-
-
- - + @if ($githubManualWebhook && $gitlabManualWebhook) + +
+ + -
- - Webhook Configuration on GitHub - - - -
- - -
- Save - +
+ + Webhook Configuration on GitHub + + + +
+ + +
+ Save + + @else + You are using an official Git App. You do not need manual webhooks. + @endif