From 902aacacc555e45c2347902059d470bf31afe72d Mon Sep 17 00:00:00 2001 From: kylecarbs Date: Fri, 29 Apr 2022 23:10:57 +0000 Subject: [PATCH] fix: Add "GIT_COMMITTER_*" to remove Git prompt A prompt would appear to globally configure the email or name before. We already have this information, so we can set the environment variables! --- agent/agent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/agent.go b/agent/agent.go index 678f78fbf6f22..bb3016d057658 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -343,8 +343,11 @@ func (a *agent) createCommand(ctx context.Context, rawCommand string, env []stri executablePath = strings.ReplaceAll(executablePath, "\\", "/") cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_SSH_COMMAND=%s gitssh --`, executablePath)) // These prevent the user from having to specify _anything_ to successfully commit. + // Both author and committer must be set! cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_EMAIL=%s`, a.ownerEmail.Load())) + cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_EMAIL=%s`, a.ownerEmail.Load())) cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_AUTHOR_NAME=%s`, a.ownerUsername.Load())) + cmd.Env = append(cmd.Env, fmt.Sprintf(`GIT_COMMITTER_NAME=%s`, a.ownerEmail.Load())) // Load environment variables passed via the agent. // These should override all variables we manually specify.