Skip to content

Commit 75abc47

Browse files
authored
Merge pull request #803 from Dokploy/690-dokploy-projects-seem-to-be-linked-together-in-special-cases
fix: allow multiple repositories from same name github #690
2 parents db27ec0 + c4c4b45 commit 75abc47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/dokploy/pages/api/deploy/github.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,16 @@ export default async function handler(
6363
const repository = githubBody?.repository?.name;
6464
const deploymentTitle = extractCommitMessage(req.headers, req.body);
6565
const deploymentHash = extractHash(req.headers, req.body);
66+
const owner = githubBody?.repository?.owner?.name;
67+
6668

6769
const apps = await db.query.applications.findMany({
6870
where: and(
6971
eq(applications.sourceType, "github"),
7072
eq(applications.autoDeploy, true),
7173
eq(applications.branch, branchName),
72-
eq(applications.repository, repository)
74+
eq(applications.repository, repository),
75+
eq(applications.owner, owner)
7376
),
7477
});
7578

@@ -103,7 +106,8 @@ export default async function handler(
103106
eq(compose.sourceType, "github"),
104107
eq(compose.autoDeploy, true),
105108
eq(compose.branch, branchName),
106-
eq(compose.repository, repository)
109+
eq(compose.repository, repository),
110+
eq(compose.owner, owner)
107111
),
108112
});
109113

0 commit comments

Comments
 (0)