diff options
| author | Matt Silverlock <[email protected]> | 2026-01-02 14:54:43 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-02 13:54:43 -0600 |
| commit | 6e68ea034c0057e39f031dc4476fa9a8349370df (patch) | |
| tree | 1934c8073e4d4aae3731851e5581d89467efe71f | |
| parent | c51fa7cb24f184514be7964546083bf2378ca36b (diff) | |
| download | opencode-6e68ea034c0057e39f031dc4476fa9a8349370df.tar.gz opencode-6e68ea034c0057e39f031dc4476fa9a8349370df.zip | |
fix: handle actions/checkout v6 credential storage change (#6667)
| -rw-r--r-- | packages/opencode/src/cli/cmd/github.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/cmd/github.ts b/packages/opencode/src/cli/cmd/github.ts index 0bda43ea7..f1cbe8e7f 100644 --- a/packages/opencode/src/cli/cmd/github.ts +++ b/packages/opencode/src/cli/cmd/github.ts @@ -994,12 +994,16 @@ export const GithubRunCommand = cmd({ console.log("Configuring git...") const config = "http.https://github.com/.extraheader" - const ret = await $`git config --local --get ${config}` - gitConfig = ret.stdout.toString().trim() + // actions/checkout@v6 no longer stores credentials in .git/config, + // so this may not exist - use nothrow() to handle gracefully + const ret = await $`git config --local --get ${config}`.nothrow() + if (ret.exitCode === 0) { + gitConfig = ret.stdout.toString().trim() + await $`git config --local --unset-all ${config}` + } const newCredentials = Buffer.from(`x-access-token:${appToken}`, "utf8").toString("base64") - await $`git config --local --unset-all ${config}` await $`git config --local ${config} "AUTHORIZATION: basic ${newCredentials}"` await $`git config --global user.name "${AGENT_USERNAME}"` await $`git config --global user.email "${AGENT_USERNAME}@users.noreply.github.com"` |
