From d6f819e78e9621f749b14889c4d5801a7b39843e Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Wed, 26 Jun 2024 21:44:09 +0000 Subject: [PATCH] [agent] run git checkout if branch is defined --- src/cmd/agent.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cmd/agent.ts b/src/cmd/agent.ts index f688a26..94a0a3b 100644 --- a/src/cmd/agent.ts +++ b/src/cmd/agent.ts @@ -202,6 +202,16 @@ async function gitClone(url: string, id: string, branch?: string) { stdout: "inherit", stderr: "inherit", }); + + if (branch) { + await new Deno.Command("pkgx", { + args: ["git", "checkout", branch], + cwd: `${dir("home")}/.fluentci/builds/${id}/${url.split("/").pop()}`, + stdout: "inherit", + stderr: "inherit", + }).spawn().status; + } + await git.spawn().status; }