Skip to content

Commit

Permalink
feat(CoAuthor)!: Include the commit message to contain the selected c…
Browse files Browse the repository at this point in the history
…o-authors

Co-authored-by: Henri Remonen <81435393+HRemonen@users.noreply.github.com>
Co-authored-by: Henri Remonen <henri@remonen.fi>
BREAKING CHANGE: Testing what it looks like to have co-authors and breaking change
  • Loading branch information
HRemonen committed Sep 9, 2023
1 parent ed59f16 commit c43c0ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Binary file modified commitsense
Binary file not shown.
13 changes: 10 additions & 3 deletions pkg/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,19 @@ func createCommitMessage(commitInfo Info) string {
commitMessage += "\n\n" + commitInfo.CommitBody
}

if commitInfo.IsBreakingChange {
commitMessage += "\n\n"
// Separate footer from the body
if commitInfo.IsBreakingChange || commitInfo.IsCoAuthored {
commitMessage += "\n"
}

if commitInfo.IsCoAuthored {
for _, coauth := range commitInfo.CoAuthors {
commitMessage += "\nCo-authored-by: " + coauth
}
}

if commitInfo.IsBreakingChange {
commitMessage += "BREAKING CHANGE: " + commitInfo.BreakingChangeDescription
commitMessage += "\nBREAKING CHANGE: " + commitInfo.BreakingChangeDescription
}

return commitMessage
Expand Down

0 comments on commit c43c0ca

Please sign in to comment.