diff --git a/src/github/operations/branch.ts b/src/github/operations/branch.ts index 42e78298e..e0174c6bd 100644 --- a/src/github/operations/branch.ts +++ b/src/github/operations/branch.ts @@ -6,7 +6,7 @@ * - For Issues: Create a new branch */ -import { $ } from "bun"; +import { $, spawn } from "bun"; import * as core from "@actions/core"; import type { ParsedGitHubContext } from "../context"; import type { GitHubPullRequest } from "../types"; @@ -54,7 +54,13 @@ export async function setupBranch( ); // Execute git commands to checkout PR branch (dynamic depth based on PR size) - await $`git fetch origin --depth=${fetchDepth} ${branchName}`; + await spawn([ + "git", + "fetch", + "origin", + `--depth=${fetchDepth}`, + branchName, + ]).exited; await $`git checkout ${branchName} --`; console.log(`Successfully checked out PR branch for PR #${entityNumber}`);