refactor: add continue to is cloud

This commit is contained in:
Mauricio Siu
2025-01-26 15:17:26 -06:00
parent ac49235916
commit 8d31574e5f

View File

@@ -182,8 +182,9 @@ export default async function handler(
} }
} else if (req.headers["x-github-event"] === "pull_request") { } else if (req.headers["x-github-event"] === "pull_request") {
const prId = githubBody?.pull_request?.id; const prId = githubBody?.pull_request?.id;
const action = githubBody?.action;
if (githubBody?.action === "closed") { if (action === "closed") {
const previewDeploymentResult = const previewDeploymentResult =
await findPreviewDeploymentsByPullRequestId(prId); await findPreviewDeploymentsByPullRequestId(prId);
@@ -203,7 +204,11 @@ export default async function handler(
} }
// opened or synchronize or reopened // 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 repository = githubBody?.repository?.name;
const deploymentHash = githubBody?.pull_request?.head?.sha; const deploymentHash = githubBody?.pull_request?.head?.sha;
const branch = githubBody?.pull_request?.base?.ref; const branch = githubBody?.pull_request?.base?.ref;
@@ -264,7 +269,7 @@ export default async function handler(
if (IS_CLOUD && app.serverId) { if (IS_CLOUD && app.serverId) {
jobData.serverId = app.serverId; jobData.serverId = app.serverId;
await deploy(jobData); await deploy(jobData);
return true; continue;
} }
await myQueue.add( await myQueue.add(
"deployments", "deployments",