From 8d31574e5f0739b086722706b7f38b81de25577f Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 26 Jan 2025 15:17:26 -0600 Subject: [PATCH] refactor: add continue to is cloud --- apps/dokploy/pages/api/deploy/github.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/pages/api/deploy/github.ts b/apps/dokploy/pages/api/deploy/github.ts index 0cb7cf360..761c38663 100644 --- a/apps/dokploy/pages/api/deploy/github.ts +++ b/apps/dokploy/pages/api/deploy/github.ts @@ -182,8 +182,9 @@ export default async function handler( } } else if (req.headers["x-github-event"] === "pull_request") { const prId = githubBody?.pull_request?.id; + const action = githubBody?.action; - if (githubBody?.action === "closed") { + if (action === "closed") { const previewDeploymentResult = await findPreviewDeploymentsByPullRequestId(prId); @@ -203,7 +204,11 @@ export default async function handler( } // opened or synchronize or reopened - if (githubBody?.action === "opened" || githubBody?.action === "synchronize" || githubBody?.action === "reopened") { + if ( + action === "opened" || + action === "synchronize" || + action === "reopened" + ) { const repository = githubBody?.repository?.name; const deploymentHash = githubBody?.pull_request?.head?.sha; const branch = githubBody?.pull_request?.base?.ref; @@ -264,7 +269,7 @@ export default async function handler( if (IS_CLOUD && app.serverId) { jobData.serverId = app.serverId; await deploy(jobData); - return true; + continue; } await myQueue.add( "deployments",