diff --git a/action/git.go b/action/git.go index 8c657c8..193ce4b 100644 --- a/action/git.go +++ b/action/git.go @@ -78,6 +78,11 @@ type GitCommitInput struct { // GitCommitActivity commits changes in a worktree. func GitCommitActivity(ctx context.Context, in GitCommitInput) error { + // Configure git user for commits if not already configured + // (worktrees don't inherit config from main repo) + exec.CommandContext(ctx, "git", "-C", in.WorktreePath, "config", "user.email", "poimen@riotpiao.com").Run() + exec.CommandContext(ctx, "git", "-C", in.WorktreePath, "config", "user.name", "Poimen Agent").Run() + // Stage all changes cmd := exec.CommandContext(ctx, "git", "-C", in.WorktreePath, "add", "-A") if err := cmd.Run(); err != nil {