Skip to content

Commit

Permalink
Normalize repo names for comparision
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Smith <[email protected]>
  • Loading branch information
Chris Smith committed Oct 28, 2019
1 parent bb557b1 commit f45e959
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ func processHook(c *gin.Context) {
repoSplit := strings.Split(*payload.Repo.FullName, "/")
checkSplit := strings.Split(repoOrOrgName, "/")

if repoSplit[0] != checkSplit[0] {
if strings.ToLower(repoSplit[0]) != strings.ToLower(checkSplit[0]) {
c.JSON(http.StatusForbidden, gin.H{"message": "Not configured for this repository"})
return
} else if len(checkSplit) > 1 && repoSplit[1] != checkSplit[1] {
} else if len(checkSplit) > 1 && strings.ToLower(repoSplit[1]) != strings.ToLower(checkSplit[1]) {
c.JSON(http.StatusForbidden, gin.H{"message": "Not configured for this repository"})
return
}
Expand Down

0 comments on commit f45e959

Please sign in to comment.