From c4c4b459cc423597e770fb75c4f605501345d780 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:26:52 -0600 Subject: [PATCH] fix: allow multiple repositories from same name github #690 --- apps/dokploy/pages/api/deploy/github.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 1d8c094a..7f0e7f0b 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -63,13 +63,16 @@ export default async function handler( const repository = githubBody?.repository?.name; const deploymentTitle = extractCommitMessage(req.headers, req.body); const deploymentHash = extractHash(req.headers, req.body); + const owner = githubBody?.repository?.owner?.name; + const apps = await db.query.applications.findMany({ where: and( eq(applications.sourceType, "github"), eq(applications.autoDeploy, true), eq(applications.branch, branchName), - eq(applications.repository, repository) + eq(applications.repository, repository), + eq(applications.owner, owner) ), }); @@ -103,7 +106,8 @@ export default async function handler( eq(compose.sourceType, "github"), eq(compose.autoDeploy, true), eq(compose.branch, branchName), - eq(compose.repository, repository) + eq(compose.repository, repository), + eq(compose.owner, owner) ), });