Skip to content

Commit

Permalink
fix(policy): strip leading newline from commit message (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrynhard authored Jan 11, 2018
1 parent 779bf93 commit 4b7b903
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/policy/conventionalcommit/conventionalcommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ func parseHeader(message string) []string {
if err != nil {
return nil
}
header := strings.Split(message, "\n")[0]
// To circumvent any policy violation due to the leading \n that GitHub
// prefixes to the commit message on a squash merge, we remove it from the
// message.
header := strings.Split(strings.TrimPrefix(message, "\n"), "\n")[0]
groups := re.FindStringSubmatch(header)

return groups
Expand Down

0 comments on commit 4b7b903

Please sign in to comment.