Skip to content
award

GitHub Action

Changelog Driven Release

v1.0.14 Latest version

Changelog Driven Release

award

Changelog Driven Release

Release a new version of your project when you update the changelog

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Changelog Driven Release

uses: ipdxco/[email protected]

Learn more about this action in ipdxco/changelog-driven-release

Choose a version

Changelog Driven Release

Changelog Driven Release is a GitHub Actions reusable workflow that automates the release process based on changes to a changelog file that follows keep a changelog guidelines.

Usage

To use the reusable workflow, add the following file to your GitHub Actions workflow directory:

name: Release

on:
  push:
    paths: [CHANGELOG.md]
    branches: [main]
  pull_request:
    paths: [CHANGELOG.md]
    branches: [main]

permissions:
  contents: write

jobs:
  publish:
    uses: ipdxco/changelog-driven-release/.github/workflows/pr.yml@v1

See the full example of how we use Changelog Driven Release to release Changelog Driven Release 🔁

Inputs

  • path: The path to the changelog file. Default: CHANGELOG.md.
  • draft: Whether the release should be a draft or not. Default: true
  • mutable: Whether mutable tags should be updated or not (i.e. if in addition to vX.Y.Z, vX.Y and vX should be created). Default: true
  • token: The GitHub token. Default: ${{ github.token }}

Outputs

  • url: The URL of the created release.
  • tag: The main tag of the release.
  • tags: The tags of the release.
  • body: The description the release was created with.
  • previous_comment_id: The ID of the comment that was created on the previous release.
  • created_comment_id: The ID of the comment that was created on the current release.

How it works

The Changelog Driven Release reusable workflow automates the release process based on changes to a changelog file that follows the keep a changelog guidelines.

When run, the worfklow looks for the top-most release section in the changelog file and extracts the tag information from it. If the tag already exists, it exits without creating a new release. If the tag does not exist, it creates a new GitHub release with the extracted tag (draft if the run happens in the context of a PR). It creates three tags on publish (merge): the main tag (vX.Y.Z), as well as two additional tags for the major (vX) and major-minor (vX.Y) version numbers.

Finally, if the run happens in the context of a PR, it creates a comment with the changelog section's contents.

It supports both prerelease and build version suffixes.