PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes.
A PHP CLI to update a CHANGELOG following the "Keep a Changelog" format with the latest release notes.
Want to automate the process of updating your Changelog with GitHub Actions? Checkout the stefanzweifel/changelog-updater-action which does exactly that.
You can install the changelog-updater CLI as a global composer dependency. It requires PHP 8.0 or higher.
composer global require wnx/changelog-updater
You can use
changelog-updater by running the
update command with the following options.
php changelog-updater update \ --release-notes="### Added - New Feature A - New Feature B ### Changed - Update Feature C ### Removes - Remove Feature D" \ --latest-version="v1.0.0" \ --release-date="2021-08-07" \ --path-to-changelog="CHANGELOG.md" \ --write
--write are optional. Learn more about the options by running
php changelog-updater update --help.
Note that the Changelog MUST follow the "Keep a Changelog"-format.
The CLI looks for a second level "Unreleased"-heading with a link. The link MUST point to the compare view of the latest version and
The CLI also looks for a second level heading with the name of the previous version. (If you release
v1.1.0 now, the previous version might be
Here is an example Markdown file, that will work fine with the CLI.
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/org/repo/compare/v0.1.0...HEAD) *Please do not manually update this file. We've automated the process.* ## v0.1.0 - 2021-01-01 ### Added - Initial Release
The content between the "Unreleased"-heading and the latest version will remain untouched by the CLI.
Required. The release notes you want to add to your CHANGELOG. Should be markdown.
Required. Version number of the latest release. The value will be used as the heading text and as a parameter in the compare URL.
Optional (Defaults to current date). The date the latest version has been released. The value will be used in the release heading.
Optional (Defaults to
CHANGELOG.md). Path to CHANGELOG.md file.
Optional. Write the changes to
CHANGELOG.md or to the value of
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.