From 3813f40cba187827ce3c516f629a8fd9494c56d8 Mon Sep 17 00:00:00 2001 From: "sati.ac" Date: Mon, 3 Jul 2023 03:43:44 +0000 Subject: [PATCH] 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 Co-committed-by: sati.ac --- pkg/runner/step_action_remote.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/runner/step_action_remote.go b/pkg/runner/step_action_remote.go index 28a49d0..c113284 100644 --- a/pkg/runner/step_action_remote.go +++ b/pkg/runner/step_action_remote.go @@ -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) }