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}` }