From 0590ed7b2e1b4e05cef7579249eb8628cb9e3c44 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 14 Nov 2023 14:07:48 +0100 Subject: [PATCH] Update webhooks configuration and application search. --- .../views/livewire/project/shared/webhooks.blade.php | 8 +++++++- routes/webhooks.php | 7 +++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/views/livewire/project/shared/webhooks.blade.php b/resources/views/livewire/project/shared/webhooks.blade.php index b47aba097..243b5dea3 100644 --- a/resources/views/livewire/project/shared/webhooks.blade.php +++ b/resources/views/livewire/project/shared/webhooks.blade.php @@ -12,13 +12,19 @@

Manual Git Webhooks

-
+
+
+ + Webhook Configuration on GitHub + + +
where('git_repository', 'like', "%$full_name%"); + $applications = Application::where('git_repository', 'like', "%$full_name%"); if ($x_gitlab_event === 'push') { $applications = $applications->where('git_branch', $branch)->get(); if ($applications->isEmpty()) { @@ -192,7 +192,6 @@ Route::post('/source/github/events/manual', function () { if ($content_type !== 'application/json') { $payload = json_decode(data_get($payload, 'payload'), true); } - ray($payload); if ($x_github_event === 'push') { $branch = data_get($payload, 'ref'); $full_name = data_get($payload, 'repository.full_name'); @@ -213,8 +212,7 @@ Route::post('/source/github/events/manual', function () { if (!$branch) { return response('Nothing to do. No branch found in the request.'); } - $applications = Application::whereNotNull('private_key_id')->where('git_repository', 'like', "%$full_name%"); - + $applications = Application::where('git_repository', 'like', "%$full_name%"); if ($x_github_event === 'push') { $applications = $applications->where('git_branch', $branch)->get(); if ($applications->isEmpty()) { @@ -227,6 +225,7 @@ Route::post('/source/github/events/manual', function () { return response("Nothing to do. No applications found with branch '$base_branch'."); } } + ray($applications); foreach ($applications as $application) { ray($application); $webhook_secret = data_get($application, 'manual_webhook_secret_github');