diff --git a/internal/policy/commit/check_body.go b/internal/policy/commit/check_body.go index a462a319..0a69dec5 100644 --- a/internal/policy/commit/check_body.go +++ b/internal/policy/commit/check_body.go @@ -28,6 +28,9 @@ func (h Body) Name() string { // Message returns to check message. func (h Body) Message() string { + if len(h.errors) != 0 { + return h.errors[0].Error() + } return "Commit body is valid" } diff --git a/internal/policy/commit/check_number_of_commits.go b/internal/policy/commit/check_number_of_commits.go index 3c98201d..2c5ff52f 100644 --- a/internal/policy/commit/check_number_of_commits.go +++ b/internal/policy/commit/check_number_of_commits.go @@ -27,6 +27,9 @@ func (h NumberOfCommits) Name() string { // Message returns to check message. func (h NumberOfCommits) Message() string { + if len(h.errors) != 0 { + return h.errors[0].Error() + } return fmt.Sprintf("HEAD is %d commit(s) ahead of %s", h.ahead, h.ref) }