From 37aa066e8d426ab03a20d62e6539caec2d9948cf Mon Sep 17 00:00:00 2001 From: Thomas Gleason Date: Wed, 20 Nov 2024 20:05:02 -0700 Subject: [PATCH] fix(ssh-workspace-id): fixes parsing for git ssh urls Signed-off-by: Thomas Gleason --- pkg/workspace/id.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/workspace/id.go b/pkg/workspace/id.go index 49fe13f3c..864d17753 100644 --- a/pkg/workspace/id.go +++ b/pkg/workspace/id.go @@ -19,7 +19,9 @@ var ( func ToID(str string) string { str = strings.ToLower(filepath.ToSlash(str)) splitted := strings.Split(str, "@") - if len(splitted) == 2 { + isSshRef := len(splitted) > 1 && strings.LastIndex(str, ":") > -1; + + if len(splitted) == 2 && !isSshRef { // 1. Check if PR was specified if prReferenceRegEx.MatchString(str) { str = prReferenceRegEx.ReplaceAllStringFunc(splitted[1], git.GetIDForPR)