Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Fix: Prevent double deployments when multiple GitHub Apps access same repository (#2315)

Andras Bacsai0e47de81d195
diff --git a/app/Http/Controllers/Webhook/Github.php b/app/Http/Controllers/Webhook/Github.php
index b2c211fa8f..c8402cbf48 100644
--- a/app/Http/Controllers/Webhook/Github.php
+++ b/app/Http/Controllers/Webhook/Github.php
@@ -309,7 +309,9 @@ class Github extends Controller
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()) {