From 70b8fc57de6284ba1bec05b7490223d66af5e95e Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Wed, 23 Oct 2024 12:23:40 -0600 Subject: [PATCH] add private key file --- internal/pkg/bailiff/repush.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/bailiff/repush.go b/internal/pkg/bailiff/repush.go index 540d148..df650c2 100644 --- a/internal/pkg/bailiff/repush.go +++ b/internal/pkg/bailiff/repush.go @@ -38,6 +38,7 @@ func (s *ShellRepusher) Clone(ctx context.Context, repoURL string) error { s.mtx.Lock() defer s.mtx.Unlock() + env := fmt.Sprintf("GIT_SSH_COMMAND=ssh -i %s -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new", s.privateKeyFile) cmd := exec.CommandContext( ctx, "git", @@ -46,7 +47,7 @@ func (s *ShellRepusher) Clone(ctx context.Context, repoURL string) error { ".", ) cmd.Dir = s.workdir - cmd.Env = append(cmd.Env, "GIT_SSH_COMMAND=ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new") + cmd.Env = append(cmd.Env, env) doneC := make(chan struct{}) if err := s.logOutput(cmd, doneC); err != nil {