Add pull action and restructure git actions policy

This commit is contained in:
Mohamed Boudra
2026-04-10 20:13:59 +07:00
parent e22fb51975
commit 497159ada8
13 changed files with 422 additions and 117 deletions
+13
View File
@@ -1757,6 +1757,19 @@ export async function mergeFromBase(
}
}
export async function pullCurrentBranch(cwd: string): Promise<void> {
await requireGitRepo(cwd);
const currentBranch = await getCurrentBranch(cwd);
if (!currentBranch || currentBranch === "HEAD") {
throw new Error("Unable to determine current branch for pull");
}
const hasRemote = await hasOriginRemote(cwd);
if (!hasRemote) {
throw new Error("Remote 'origin' is not configured.");
}
await execAsync("git pull", { cwd });
}
export async function pushCurrentBranch(cwd: string): Promise<void> {
await requireGitRepo(cwd);
const currentBranch = await getCurrentBranch(cwd);