use remoteAction.URL if not empty (#71)

Fixes https://github.com/go-gitea/gitea/issues/25615

Reviewed-on: https://gitea.com/gitea/act/pulls/71
Co-authored-by: sati.ac <sati.ac@noreply.gitea.com>
Co-committed-by: sati.ac <sati.ac@noreply.gitea.com>
This commit is contained in:
sati.ac 2023-07-03 03:43:44 +00:00 committed by Jason Song
parent eb19987893
commit 3813f40cba

View file

@ -215,9 +215,14 @@ type remoteAction struct {
}
func (ra *remoteAction) CloneURL(u string) string {
if !strings.HasPrefix(u, "http://") && !strings.HasPrefix(u, "https://") {
u = "https://" + u
if ra.URL == "" {
if !strings.HasPrefix(u, "http://") && !strings.HasPrefix(u, "https://") {
u = "https://" + u
}
} else {
u = ra.URL
}
return fmt.Sprintf("%s/%s/%s", u, ra.Org, ra.Repo)
}