Pull Request actions filter

This commit is contained in:
Vyacheslav Shcherbinin
2025-01-25 10:51:22 +07:00
parent c6569f70e4
commit ac49235916

View File

@@ -201,7 +201,9 @@ export default async function handler(
res.status(200).json({ message: "Preview Deployment Closed" }); res.status(200).json({ message: "Preview Deployment Closed" });
return; return;
} }
// opened or synchronize or reopened // opened or synchronize or reopened
if (githubBody?.action === "opened" || githubBody?.action === "synchronize" || githubBody?.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;
@@ -275,6 +277,7 @@ export default async function handler(
} }
return res.status(200).json({ message: "Apps Deployed" }); return res.status(200).json({ message: "Apps Deployed" });
} }
}
return res.status(400).json({ message: "No Actions matched" }); return res.status(400).json({ message: "No Actions matched" });
} }