feat(changelog): show authors of commits and show body as header

Enable new features in `.release.yml` like

```yml

changelog:
  showAuthors: false  ## Show authors in changelog
  showBodyAsHeader: false  ## Show all bodies of the commits as header of changelog (useful for squash commit flow to show long text in release)

```
This commit is contained in:
Sebastian Beisch
2022-04-11 15:58:37 +02:00
committed by Felix Wiedmann
parent 03f2eeadaa
commit 0c7338ab13
13 changed files with 273 additions and 482 deletions

View File

@@ -3,9 +3,10 @@ package gitutil
import (
"fmt"
"github.com/pkg/errors"
"sort"
"github.com/pkg/errors"
"github.com/Masterminds/semver"
"github.com/Nightapes/go-semantic-release/internal/shared"
"github.com/go-git/go-git/v5"
@@ -176,10 +177,10 @@ func (g *GitUtil) GetCommits(lastTagHash *plumbing.Reference) ([]shared.Commit,
commits := make(map[string]shared.Commit)
err = cIter.ForEach(func(c *object.Commit) error {
log.Debugf("Found commit with hash %s", c.Hash.String())
log.Debugf("Found commit with hash %s from %s", c.Hash.String(), c.Author.Name)
commits[c.Hash.String()] = shared.Commit{
Message: c.Message,
Author: c.Committer.Name,
Author: c.Author.Name,
Hash: c.Hash.String(),
}
return nil