~comcloudway/builds.sr.ht

7ad6e5e0996119bff356d6d0f443774ebec2f477 — Drew DeVault 5 years ago 9693da6
Fix host key check on git/hg clone
1 files changed, 6 insertions(+), 2 deletions(-)

M worker/tasks.go
M worker/tasks.go => worker/tasks.go +6 -2
@@ 322,7 322,9 @@ func (ctx *JobContext) CloneRepos() error {
		if scm == "git" {
			repo_name := path.Base(purl.Path)
			repo_name = strings.TrimSuffix(repo_name, ".git")
			git := ctx.SSH("git", "clone", "--recursive", purl.String())
			git := ctx.SSH("GIT_SSH_COMMAND='ssh -o " +
				"UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'",
				"git", "clone", "--recursive", purl.String())
			git.Stdout = ctx.LogFile
			git.Stderr = ctx.LogFile
			if err := git.Run(); err != nil {


@@ 343,7 345,9 @@ func (ctx *JobContext) CloneRepos() error {
			}
		} else if scm == "hg" {
			repo_name := path.Base(purl.Path)
			hg := ctx.SSH("hg", "clone", purl.String())
			hg := ctx.SSH("hg", "clone",
				"-e", "'ssh -o UserKnownHostsFile=/dev/null " +
				"-o StrictHostKeyChecking=no'", purl.String())
			hg.Stdout = ctx.LogFile
			hg.Stderr = ctx.LogFile
			if err := hg.Run(); err != nil {