Skip to content

tomtom-international/keepachangelog-action

Manage your CHANGELOG.md using the Keepachangelog Convention

This GitHub Action allows you to setup a full release workflow based around your CHANGELOG.md, incl:

  • Validation of your CHANGELOG.md file against the keepachangelog convention
  • Releasing the [Unreleased] version in your CHANGELOG.md
  • Publication of a GitHub Release, associated with the previously released version

Prerequisites

Usage

Validating your CHANGELOG.md

You can use the following workflow syntax to validate your CHANGELOG.md:

name: Quality Checks
on:
  pull_request:

jobs:
  changelog:
    name: Validate Changelog
    runs-on: ubuntu-latest

    steps:
      - name: Setup Python v3.7
        uses: actions/setup-python@v3
        with:
          python-version: '3.7'

      - name: Validate Changelog
        uses: tomtom-international/keepachangelog-action
        with:
          token: ${{ github.token }}

💡 Any non-conformity will automatically appear as file annotation in your Pull Request

Release your CHANGELOG.md

This action provides the ability to automatically release the contents of the [Unreleased] version. As result:

  • Your CHANGELOG.md is automatically updated and pushed to your main branch
  • A GitHub Release is created on the commit hash of the previous update commit.

Example workflow:

name: Release Changelog

concurrency: deployment

on:
  push:
    branches:
      - main

jobs:
  release-changelog:
    name: Release Changelog
    runs-on: ubuntu-latest

    steps:
      - name: Setup Python v3.7
        uses: actions/setup-python@v3
        with:
          python-version: '3.7'

      - name: Release Changelog
        uses: tomtom-international/keepachangelog-action
        with:
          publish: true
          token: ${{ github.token }}

Inputs

Name Required Description
token GitHub token used to access GitHub (eg. github.token)
publish Boolean indicating whether to release and publish the latest [Unreleased] version. Executes the validation step only if this input is not provided
tag Formatter used for applying the tag name, defaults to: {version}
release-name Formatter used for applying the GitHub Release name, defaults to: Release {tag}
commit-message Message to use while creating the Pull Request to update your CHANGELOG.md, defaults to: docs(release): update CHANGELOG.md for '{release-name}'

Outputs

Name Description
version Contains the Semantic Version of the latest release. This is only set in case publish: true.