mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(webhooks): clean up closed GitLab MRs after target branch changes (#12012)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e02f932a34
commit
1464b751b1
@@ -231,7 +231,10 @@ class Gitlab extends Controller
|
||||
'skip_deploy' => $skip_deploy_pr,
|
||||
] = $this->readMergeRequestPayload($payload);
|
||||
|
||||
$applications = $applications->where('git_branch', $base_branch)->get();
|
||||
if (! in_array($action, ['closed', 'close', 'merge'])) {
|
||||
$applications->where('git_branch', $base_branch);
|
||||
}
|
||||
$applications = $applications->get();
|
||||
|
||||
foreach ($applications as $application) {
|
||||
if (! $application->destination->server->isFunctional()) {
|
||||
@@ -440,7 +443,10 @@ class Gitlab extends Controller
|
||||
}
|
||||
}
|
||||
if ($x_gitlab_event === 'merge_request') {
|
||||
$applications = $this->manualWebhookApplications($applications->where('git_branch', $base_branch), $full_name);
|
||||
if (! in_array($action, ['closed', 'close', 'merge'])) {
|
||||
$applications->where('git_branch', $base_branch);
|
||||
}
|
||||
$applications = $this->manualWebhookApplications($applications, $full_name);
|
||||
if ($applications->isEmpty()) {
|
||||
return $this->unauthenticatedManualWebhookResponse($failure_key, $failure_attempt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user