From 094e1d1bba6f9346907a64267e3ce4b45dfd19af Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jan 2024 14:29:54 +0100 Subject: [PATCH] Fix condition for merge_request actions in webhooks.php --- routes/webhooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/webhooks.php b/routes/webhooks.php index 21dffee80..1fb0bce4e 100644 --- a/routes/webhooks.php +++ b/routes/webhooks.php @@ -163,7 +163,7 @@ } } if ($x_gitlab_event === 'merge_request') { - if ($action === 'open' ||$action === 'opened' || $action === 'synchronize' || $action === 'reopened' || $action === 'reopen' || $action === 'update') { + if ($action === 'open' || $action === 'opened' || $action === 'synchronize' || $action === 'reopened' || $action === 'reopen' || $action === 'update') { if ($application->isPRDeployable()) { $deployment_uuid = new Cuid2(7); $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); @@ -197,7 +197,7 @@ ]); ray('Preview deployments disabled for ' . $application->name); } - } else if ($action === 'closed') { + } else if ($action === 'closed' || $action === 'close') { $found = ApplicationPreview::where('application_id', $application->id)->where('pull_request_id', $pull_request_id)->first(); if ($found) { $found->delete();