Home

Awesome

:memo: changelog-generator-default

CI Go Report Card PkgGoDev

The default changelog generator for go-semantic-release.

Output of the changelog

The changelog generator will order the types of commits in the changelog in the following order:

Emoji Changelogs

In order to use emoji changelogs including a prefixed emoji, you need to provide the following config when calling semantic-relase: --changelog-generator-opt "emojis=true". Or add the config within your .semrelrc file.

Example Change Log

Format Commit Template

The plugin allows to specify the template which is used to render commits with the --changelog-generator-opt CLI flag, e.g., --changelog-generator-opt "format_commit_template={{.Message}}". Or by adding the format_commit_template option within your .semrelrc file.

The following variables are available:

VariableDescription
.SHAThe commit SHA (e.g., c862ecee7682be648289579b515dbc03a5357c89).
.TypeThe type of the commit (e.g., feat, fix, chore, etc).
.ScopeThe scope of the commit.
.MessageThe first line of the commit message.
.RawThe raw commit message as a string array representing each line of the commit.
.AnnotationsA map containing different commit annotations like the author_name or author_email.

Additionally, the following functions are available:

FunctionDescription
trimSHATrims the SHA to the its first eight characters

Examples:

TemplateExample Output
* {{with .Scope -}} **{{.}}:** {{end}} {{- .Message}} ({{trimSHA .SHA}})* **app:** commit message (12345678)
* {{with .Scope -}} **{{.}}:** {{end}} {{- .Message}} ({{trimSHA .SHA}}) {{- with index .Annotations "author_login" }} - by @{{.}} {{- end}}* **app:** commit message (12345678) - by @commit-author

Licence

The MIT License (MIT)

Copyright © 2020 Christoph Witzko