diff --git a/apps/dokploy/pages/api/deploy/[refreshToken].ts b/apps/dokploy/pages/api/deploy/[refreshToken].ts index d65f6834..7b4e0a75 100644 --- a/apps/dokploy/pages/api/deploy/[refreshToken].ts +++ b/apps/dokploy/pages/api/deploy/[refreshToken].ts @@ -66,6 +66,18 @@ export default async function handler( res.status(301).json({ message: "Branch Not Match" }); return; } + } else if (sourceType === "gitlab") { + const branchName = extractBranchName(req.headers, req.body); + if (!branchName || branchName !== application.gitlabBranch) { + res.status(301).json({ message: "Branch Not Match" }); + return; + } + } else if (sourceType === "bitbucket") { + const branchName = extractBranchName(req.headers, req.body); + if (!branchName || branchName !== application.bitbucketBranch) { + res.status(301).json({ message: "Branch Not Match" }); + return; + } } try { diff --git a/apps/dokploy/server/api/routers/application.ts b/apps/dokploy/server/api/routers/application.ts index 0258068a..ea1eaa58 100644 --- a/apps/dokploy/server/api/routers/application.ts +++ b/apps/dokploy/server/api/routers/application.ts @@ -226,6 +226,7 @@ export const applicationRouter = createTRPCRouter({ applicationStatus: "idle", gitlabId: input.gitlabId, gitlabProjectId: input.gitlabProjectId, + gitlabPathNamespace: input.gitlabPathNamespace, }); return true; diff --git a/apps/dokploy/server/utils/providers/gitlab.ts b/apps/dokploy/server/utils/providers/gitlab.ts index 8b45cf36..f3145c1b 100644 --- a/apps/dokploy/server/utils/providers/gitlab.ts +++ b/apps/dokploy/server/utils/providers/gitlab.ts @@ -93,8 +93,6 @@ export const cloneGitlabRepository = async ( const writeStream = createWriteStream(logPath, { flags: "a" }); const { appName, - gitlabRepository, - gitlabOwner, gitlabBranch, gitlabId, gitlabProvider,