From 724bed98327eadc98ac1783058d525c09bb09c18 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 16 Mar 2025 20:15:51 -0600 Subject: [PATCH] feat(api): enhance GitHub deployment handling with additional GitHub ID checks - Added GitHub ID checks to the deployment logic for applications and composes. - Improved the extraction of deployment title and hash from the request headers and body. - Ensured consistency in handling deployment data across different branches and repositories. --- apps/dokploy/pages/api/deploy/github.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 77ce8bda8..b32f959ee 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -93,6 +93,7 @@ export default async function handler( try { const branchName = githubBody?.ref?.replace("refs/heads/", ""); 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; @@ -107,6 +108,7 @@ export default async function handler( eq(applications.branch, branchName), eq(applications.repository, repository), eq(applications.owner, owner), + eq(applications.githubId, githubResult.githubId), ), }); @@ -151,6 +153,7 @@ export default async function handler( eq(compose.branch, branchName), eq(compose.repository, repository), eq(compose.owner, owner), + eq(compose.githubId, githubResult.githubId), ), }); @@ -240,6 +243,7 @@ export default async function handler( eq(applications.branch, branch), eq(applications.isPreviewDeploymentsActive, true), eq(applications.owner, owner), + eq(applications.githubId, githubResult.githubId), ), with: { previewDeployments: true,