fix(applications): include pull_request_id in deployment queue check to prevent duplicate deployments

This commit is contained in:
Andras Bacsai
2025-04-30 15:28:47 +02:00
parent 785eb09ea3
commit 22b88d55b3

View File

@@ -28,6 +28,7 @@ function queue_application_deployment(Application $application, string $deployme
// Check if there's already a deployment in progress or queued for this application and commit
$existing_deployment = ApplicationDeploymentQueue::where('application_id', $application_id)
->where('commit', $commit)
->where('pull_request_id', $pull_request_id)
->whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS->value, ApplicationDeploymentStatus::QUEUED->value])
->first();