I’m trying to submit a build from a private repository, and my build manifest looks like this:
image:nixos/unstableenvironment:NIX_CONFIG:| experimental-features = nix-command flakessources:- git@example.org/user/reposecrets:- something-something-somethingbuilds.sr.ht receives this manifest:
environment:BUILD_SUBMITTER:yojoGIT_REF:refs/heads/test_buildsNIX_CONFIG:| experimental-features = nix-command flakesimage:nixos/unstablesecrets:- something-something-somethingsources:- https://git.example.org/user/repo.git#headHash... which is from something happening here, I guess:
cloneURL,err:=url.Parse(ctx.headRepo.CloneURL)iferr!=nil{returnfmt.Errorf("failed to parse Gitea clone URL: %v",err)}manifestCloneURL:=*cloneURLmanifestCloneURL.Fragment=ctx.headHashsources,ok:=sourcesIface.([]interface{})if!ok{returnfmt.Errorf("invalid manifest: `sources` is not a list")}fori,srcIface:=rangesources{src,ok:=srcIface.(string)if!ok{returnfmt.Errorf("invalid manifest: `sources` contains a %T, want a string",srcIface)}// TODO: use fork parent to figure out whether we should replace// the sourceifstrings.HasSuffix(src,"/"+ctx.baseRepo.Name)||strings.HasSuffix(src,"/"+ctx.baseRepo.Name+".git"){sources[i]=manifestCloneURL.String()}My webhook request’s "clone_url" holds a value for git over https.
I don’t know enough about forgejo, maybe it should substitute the "clone_url" with "ssh_url" for private repositories, although it may be something I misconfigured 😥 or maybe yojo should use "ssh_url" if ctx.headRepo.Private :)