Skip to content

Commit

Permalink
Fix gitlab & github URL parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Nov 12, 2021
1 parent 2f4c6da commit 7389d9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/providers/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (g *gitHub) GetID() string {

func newGitHub(u *url.URL) (Provider, error) {
s := strings.Split(u.Path, "/")
if len(s) < 2 {
if len(s) < 3 {
return nil, fmt.Errorf("Error parsing Github URL %s, can't find owner and repo", u.String())
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (g *gitLab) GetLatestVersion() (string, string, error) {

func newGitLab(u *url.URL) (Provider, error) {
s := strings.Split(u.Path, "/")
if len(s) < 2 {
if len(s) < 3 {
return nil, fmt.Errorf("Error parsing GitLab URL %s, can't find owner and repo", u.String())
}

Expand Down

0 comments on commit 7389d9b

Please sign in to comment.