Skip to content

Commit 2874544

Browse files
Potential fix for code scanning alert no. 1: Incomplete regular expression for hostnames
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent cb8cc8e commit 2874544

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func _detectRemoteURL_LocalGit(path string) (string, error) {
7777
// https://github.com/mroth/bump.git
7878
// git@github.com:mroth/bump.git
7979
func parseGithubRemote(remoteURL string) (owner, repo string, ok bool) {
80-
re := regexp.MustCompile(`^(?:https://|git@)github.com[:/](.*)/(.*?)(?:\.git$|$)`)
80+
re := regexp.MustCompile(`^(?:https://|git@)github\.com[:/](.*)/(.*?)(?:\.git$|$)`)
8181
matches := re.FindStringSubmatch(remoteURL)
8282
if len(matches) < 3 {
8383
return

0 commit comments

Comments
 (0)