DEV Community

Dan Goslen
Dan Goslen

Posted on

Keep a Changelog Up To Date

My Workflow

My team recently was running into a problem generating reliable release notes for our software. We decided we wanted to automate it from a CHANGELOG.md file. However, that meant we needed to always keep that file up to date with changes.

So I made a GitHub action that enforces that changes had been made to the file 😀

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

The repository can be found here

GitHub logo dangoslen / changelog-enforcer

A simple GitHub action that enforces that a maintained changelog is kept up to date.

unit tests badge latest version coverage badge

Changelog Enforcer

The purpose of this action is to enforce that every pull request in a repository includes a change to an ongoing changelog file. Inspired by Keep A Changelog, this action helps development teams to keep a change file up to date as new features or fixes are implemented.

Usage

To use this action, follow the typical GitHub Action uses syntax. An example workflow using the default parameters of this action is shown below:

name: "Pull Request Workflow"
on
  pull_request:
    # The specific activity types are listed here to include "labeled" and "unlabeled"
    # (which are not included by default for the "pull_request" trigger).
    # This is needed to allow skipping enforcement of the changelog in PRs with specific labels,
    # as defined in the (optional) "skipLabels" property.
    types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
  # Enforces the update of
…
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

You can use this action in conjunction with the Changelog Reader Action to keep an updated CHANGELOG.md file and automatically generate release notes with your GitHub releases!

An example workflow is found in the Changelog Enforcer Workflows which creates a new version on every push to master.

Hope you enjoy it!

Top comments (0)