feat:
- git status/git add ignore the action's own clone - git checkout <branch> auto‑creates the local branch with upstream tracking
This commit is contained in:
parent
ca8abdf8b9
commit
4585d60516
1 changed files with 7 additions and 1 deletions
8
index.ts
8
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}`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue