Skip to content

Commit

Permalink
fix(ssh-workspace-id): fixes parsing for git ssh urls
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gleason <[email protected]>
  • Loading branch information
tommatime committed Nov 21, 2024
1 parent 4856dbd commit 37aa066
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/workspace/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 37aa066

Please sign in to comment.