diff --git a/changelog.md b/changelog.md index 834a272..72462e2 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), --- +## \[Unreleased\] + +### Fixed + +* Enhanced the regex to be case-insensitive and to support `.` in repository names, enabling correct extraction of the repository name from SSH URLs in baseline scan. + ## \[1.1.1\] \- 2025-09-26 ### Fixed diff --git a/output/output.go b/output/output.go index 7587408..74b1f89 100644 --- a/output/output.go +++ b/output/output.go @@ -68,10 +68,10 @@ func DisplayOutput(finalResult *finding.Output, scanTime *ScanTime) { */ func extractRepoNameFromURL(url string) string { if url != "" { - findRepoNameRegexp := regexp.MustCompile(`[a-z0-9-]+/[a-z0-9-_]+\.git$`) + findRepoNameRegexp := regexp.MustCompile(`(?i)[a-z0-9-_.]+/[a-z0-9-_.]+\.git$`) match := findRepoNameRegexp.FindStringSubmatch(url) if len(match) > 0 { - parts := strings.Split(match[0], ".") + parts := strings.Split(match[0], ".git") if len(parts) > 1 { return parts[0] }