Create Changelog

This action creates an initial Changelog from the commit history.

This is usually the included in your workflow after building and testing your library with CMake Workflow in another job with the complete matrix.

The commits considered go from the latest commit up to a commit containing a version commit pattern specified by version-pattern.

The result can be used as the initial body for an automated release, a CHANGELOG.md file, or a job summary.

Each commit is parsed as a loose variant of a conventional commit in the following format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
  • The body and footer are always ignored.

  • If no type is indicated, the description goes to an initial "other" category in the message.

  • If no scope is indicated, the description goes to an initial "general" scope in the type messages.

  • Breaking changes are indicated.

This action uses the local commit history to generate the notes. Ensure the fetch-depth option is set when cloning your repository in CI. If this option is unset, the checkout action will perform a shallow clone and the Changelog will only include the latest commit.

- uses: actions/checkout@v3
  with:
    fetch-depth: 100

This parameter can also be used as a limit on the number of commits the action should consider.

Example

steps:
- name: Changelog
  uses: alandefreitas/cpp-actions/create-changelog@v1.6.2
  with:
    output-path: CHANGELOG.md
    thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
    github-token: ${{ secrets.GITHUB_TOKEN }}
    link-commits: ${{ github.ref_name == 'develop' }}

Input Parameters

Parameter

Description

Default

source-dir

The source directory from whose commits will be analyzed.

.

version-pattern

A regex pattern used to identify if a commit is a version delimiter.

When a commit has a message that matches this pattern, the list of commits considered in the notes is complete.

This constraint does not apply to the current and latest commit.

(Bump|Set)\s+version

tag-pattern

A regex pattern used to identify if a commit is a tagged delimiter.

When a commit has the same hash has the commit associated with a tag whose name matches this pattern, the list of commits considered in the notes is complete.

This constraint does not apply to the current and latest commit.

v.\..\..*

output-path

The path where the changelog will be stored.

CHANGELOG.md

limit

The limit on the number of commits considered in the Changelog.

0

thank-non-regular

Thank non-regular contributors.

true

check-unconventional

Check for commits that do not follow the conventional commit format.

true

link-commits

Link commit ids in the changelog to the repository commit.

This is usually unnecessary because GitHub flavored markdown automatically links commits id in text to the commits in the same repository. Thus, including explicit links would often make the output more verbose and remove any extra GitHub functionality, such as pop ups associated with these ids.

However, when the outputs is only going to be used as an action summary or in any other context outside GitHub, these automatic links do not exist and it’s often a good idea to include them to allow the reader to navigate to these repository commits.

false

github-token

Github token to identify non-regular contributors. Usually secrets.GITHUB_TOKEN.

update-summary

Update action summary with the changelog.

true

trace-commands

Trace commands executed by the workflow.

false