Skip to content

Commit

Permalink
More generic git host detection
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Sep 3, 2019
1 parent cfa957d commit 76230ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/git/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ func GitHost() string {
return GITLAB
}

// More generic matching (github.example.com, etc. but could also accidently match gitlab.example.com/org/github-api)

if strings.Contains(remote, "github") {
return GITHUB
}

if strings.Contains(remote, "gitlab") {
return GITLAB
}

return ""
}

Expand Down

0 comments on commit 76230ca

Please sign in to comment.