Skip to content

Commit

Permalink
add private key file
Browse files Browse the repository at this point in the history
  • Loading branch information
mslipper committed Oct 23, 2024
1 parent d957a1b commit 70b8fc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/pkg/bailiff/repush.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down

0 comments on commit 70b8fc5

Please sign in to comment.