Fix double deployments with multiple GitHub Apps on same repo (#7604)

This commit is contained in:
Andras Bacsai 2025-12-12 11:47:24 +01:00 committed by GitHub
commit dafd10d8fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -309,7 +309,9 @@ public function normal(Request $request)
if (! $id || ! $branch) {
return response('Nothing to do. No id or branch found.');
}
$applications = Application::where('repository_project_id', $id)->whereRelation('source', 'is_public', false);
$applications = Application::where('repository_project_id', $id)
->where('source_id', $github_app->id)
->whereRelation('source', 'is_public', false);
if ($x_github_event === 'push') {
$applications = $applications->where('git_branch', $branch)->get();
if ($applications->isEmpty()) {