Formatting commit messages

go-semrel-gitlab extracts information from commit messages to determine the next version bump and to produce release notes.

Message header

The first line of commit messages should be like

type(scope): subject

or

type: subject

Breaking changes

When a commit contains a breaking change, the commit message should contain BREAKING CHANGE: to trigger a major version bump.

For example

refactor: unify flag naming
    
BREAKING CHANGE: Flags corresponding with CI_ env-vars are prefixed with 'ci-'.

- project-path -> ci-project-path
- project-url -> ci-project-url
- commit-sha -> ci-commit-sha
- commit-tag -> ci-commit-tag
- commit-ref-name -> ci-commit-ref-name

Examples

Fixes

Commit message

refactor(actions): switch to using actions api

will appear in release note in Fixes section like this

Features

Commit message

feat(next-version): add flag to return curr-ver if no changes detected
    
Fixes #38

will appear in release note in Features section like this

Breaking changes

Commit message

refactor: unify flag naming
    
BREAKING CHANGE: Flags corresponding with CI_ env-vars are prefixed with 'ci-'.

- project-path -> ci-project-path
- project-url -> ci-project-url
- commit-sha -> ci-commit-sha
- commit-tag -> ci-commit-tag
- commit-ref-name -> ci-commit-ref-name

will appear in Breaking changes section like this

unify flag naming (69485bc0)

Flags corresponding with CI_ env-vars are prefixed with ‘ci-’.