feat: handle package checking better
Node.js CI / CI (push) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m45s

This commit is contained in:
2026-02-04 08:12:51 -08:00
parent f81acbac47
commit 2bb7208bab
+4 -3
View File
@@ -333,19 +333,20 @@ const handleNewBranch = async(
const { path: repoPath } = clonedRepo;
await runGitCommand(logger, repoPath, "git checkout main");
await runGitCommand(logger, repoPath, `git checkout -b ${branchName}`);
// Check if package exists before creating branch
const currentVersion = await getCurrentVersionOnBranch(repoPath, packageName);
if (currentVersion === null) {
void logger.log("warn", `Package ${packageName} not found in package.json`);
await runGitCommand(logger, repoPath, "git checkout main");
await runGitCommand(logger, repoPath, `git branch -D ${branchName}`);
return {
error: `Package ${packageName} not found in package.json`,
status: "failed",
};
}
// Only create branch if package exists
await runGitCommand(logger, repoPath, `git checkout -b ${branchName}`);
await updatePackageAndCommit({
logger,
packageName,