diff --git a/apps/dokploy/pages/api/deploy/[refreshToken].ts b/apps/dokploy/pages/api/deploy/[refreshToken].ts index d54c8f40..349f5f64 100644 --- a/apps/dokploy/pages/api/deploy/[refreshToken].ts +++ b/apps/dokploy/pages/api/deploy/[refreshToken].ts @@ -130,6 +130,21 @@ export default async function handler( } } else if (sourceType === "gitea") { const branchName = extractBranchName(req.headers, req.body); + + const normalizedCommits = req.body?.commits?.flatMap( + (commit: any) => commit.modified, + ); + + const shouldDeployPaths = shouldDeploy( + application.watchPaths, + normalizedCommits, + ); + + if (!shouldDeployPaths) { + res.status(301).json({ message: "Watch Paths Not Match" }); + return; + } + if (!branchName || branchName !== application.giteaBranch) { res.status(301).json({ message: "Branch Not Match" }); return; @@ -230,12 +245,6 @@ export const extractCommitMessage = (headers: any, body: any) => { : "NEW COMMIT"; } - if (headers["user-agent"]?.includes("Go-http-client")) { - if (body.push_data && body.repository) { - return `Docker image pushed: ${body.repository.repo_name}:${body.push_data.tag} by ${body.push_data.pusher}`; - } - } - return "NEW CHANGES"; };