Skip to content

Commit

Permalink
fix: checks conv commit format in firstWord
Browse files Browse the repository at this point in the history
Getting a panic if conventional commits is true and imperative verb is
true and the message is not in a conventional commit format.

Signed-off-by: Peter Ng <[email protected]>
  • Loading branch information
Peter Ng authored and andrewrynhard committed Aug 8, 2019
1 parent 365c592 commit 7bed912
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/policy/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ func (c Commit) firstWord() (string, error) {
var msg string
if c.Conventional != nil {
groups = parseHeader(c.msg)
if len(groups) != 6 {
return "", errors.Errorf("Invalid conventional commit format")
}
msg = groups[4]
} else {
msg = c.msg
Expand Down

0 comments on commit 7bed912

Please sign in to comment.