Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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$`)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
findRepoNameRegexp := regexp.MustCompile(`(?i)[a-z0-9-]+/[a-z0-9-_.]+\.git$`)
findRepoNameRegexp := regexp.MustCompile(`(?i)[a-z0-9-_.]+/[a-z0-9-_.]+\.git$`)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex updated.

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]
}
Expand Down
Loading