From 4585d60516a7d2ff872be9376ec22751e32830ae Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Mon, 11 May 2026 21:20:45 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20-=20git=20status/git=20add=20ignore=20t?= =?UTF-8?q?he=20action's=20own=20clone=20-=20git=20checkout=20=20a?= =?UTF-8?q?uto=E2=80=91creates=20the=20local=20branch=20with=20upstream=20?= =?UTF-8?q?tracking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 915f1c2..1131e7a 100644 --- a/index.ts +++ b/index.ts @@ -673,6 +673,9 @@ async function configureGitIdentity() { console.log("Configuring git identity...") await $`git config --global user.name "opencode-agent[bot]"` await $`git config --global user.email "opencode-agent[bot]@users.noreply.${forgejoHost}"` + + const excludeFile = (await $`git rev-parse --git-path info/exclude`.text()).trim() + await $`echo ".opencode-action/" >> ${excludeFile}` } async function checkoutNewBranch() { @@ -687,7 +690,10 @@ async function checkoutLocalBranch(pr: ForgejoPullRequest) { const branch = pr.head.ref const { forgejoToken } = getForgejoConfig() - await authedGit(forgejoToken, ["fetch", "origin", "--depth=100", `+${branch}:${branch}`]) + await authedGit(forgejoToken, [ + "fetch", "origin", "--depth=100", + `+refs/heads/${branch}:refs/remotes/origin/${branch}`, + ]) await $`git checkout ${branch}` }