fix(clustertool): prevent git@ loop-additions
This commit is contained in:
@@ -124,8 +124,10 @@ func FormatGitURL(input string) string {
|
|||||||
input = "ssh://" + input
|
input = "ssh://" + input
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace "github.com/" with "git@github.com:" if present
|
// If the input does not start with "ssh://", add "ssh://"
|
||||||
input = strings.Replace(input, "github.com/", "git@github.com:", 1)
|
if !strings.HasPrefix(input, "ssh://git@") {
|
||||||
|
input = "ssh://git@" + input
|
||||||
|
}
|
||||||
|
|
||||||
// Compile a regex to match and replace the URL pattern
|
// Compile a regex to match and replace the URL pattern
|
||||||
re := regexp.MustCompile(`^ssh://git@github.com:(\w+)/(\w+).git$`)
|
re := regexp.MustCompile(`^ssh://git@github.com:(\w+)/(\w+).git$`)
|
||||||
|
|||||||
Reference in New Issue
Block a user