Skip to content

Commit 4a78f54

Browse files
Merge pull request #13 from certinia/enhance-regex-to-fix-extract-repo-name-from-ssh-url
bugfix: updated regex and split condition
2 parents 927a46d + 32bbd17 commit 4a78f54

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
---
88

9+
## \[Unreleased\]
10+
11+
### Fixed
12+
13+
* 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.
14+
915
## \[1.1.1\] \- 2025-09-26
1016

1117
### Fixed

output/output.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ func DisplayOutput(finalResult *finding.Output, scanTime *ScanTime) {
6868
*/
6969
func extractRepoNameFromURL(url string) string {
7070
if url != "" {
71-
findRepoNameRegexp := regexp.MustCompile(`[a-z0-9-]+/[a-z0-9-_]+\.git$`)
71+
findRepoNameRegexp := regexp.MustCompile(`(?i)[a-z0-9-_.]+/[a-z0-9-_.]+\.git$`)
7272
match := findRepoNameRegexp.FindStringSubmatch(url)
7373
if len(match) > 0 {
74-
parts := strings.Split(match[0], ".")
74+
parts := strings.Split(match[0], ".git")
7575
if len(parts) > 1 {
7676
return parts[0]
7777
}

0 commit comments

Comments
 (0)