refactor: add gitlab and bitbucket webhook support

This commit is contained in:
Mauricio Siu
2024-09-01 17:50:00 -06:00
parent d57bbff87c
commit 58aaf6e002
3 changed files with 13 additions and 2 deletions

View File

@@ -66,6 +66,18 @@ export default async function handler(
res.status(301).json({ message: "Branch Not Match" });
return;
}
} else if (sourceType === "gitlab") {
const branchName = extractBranchName(req.headers, req.body);
if (!branchName || branchName !== application.gitlabBranch) {
res.status(301).json({ message: "Branch Not Match" });
return;
}
} else if (sourceType === "bitbucket") {
const branchName = extractBranchName(req.headers, req.body);
if (!branchName || branchName !== application.bitbucketBranch) {
res.status(301).json({ message: "Branch Not Match" });
return;
}
}
try {