Skip to content

Commit 0602bbf

Browse files
committed
Fix CI: persist git identity in agent-tools test, not just override it
git -c user.email=... only overrides that single git invocation; it never writes to the repo config. The commit.gpgsign=false call was the only part that actually persisted, so the git_commit test relied on the runner having a global git identity to fall back on. Our machines all have one set, but GitHub Actions runners do not, so failed there with "Author identity unknown" on every run since 105db65.
1 parent 224a1f2 commit 0602bbf

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/src/agent-tools.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,13 @@ describe("agent-tools", () => {
499499
describe("git tools", () => {
500500
beforeEach(() => {
501501
execSync("git init -q", { cwd: workspace });
502-
execSync('git -c user.email=test@test.com -c user.name=Test config commit.gpgsign false', { cwd: workspace });
502+
// Actually persisted into the repo's config (unlike `git -c key=value`,
503+
// which only overrides that one invocation) — CI runners have no global
504+
// git identity to fall back on, so without this `git commit` fails with
505+
// "Author identity unknown".
506+
execSync('git config user.email test@test.com', { cwd: workspace });
507+
execSync('git config user.name Test', { cwd: workspace });
508+
execSync('git config commit.gpgsign false', { cwd: workspace });
503509
fs.writeFileSync(path.join(workspace, "a.txt"), "hello");
504510
});
505511

0 commit comments

Comments
 (0)