Keep a "Keep a Changelog" CHANGELOG.md coherent with the crate's declared version, and render released sections as tag messages or release bodies.
Run check on every pull request; cut and notes are what cut-release and draft-release call.
- uses: actions/checkout@v7
with:
fetch-depth: 0 # the baseline scan reads the release tags
- uses: gronke/ci/.github/actions/changelog@v3
with:
mode: checkcheck: while[Unreleased]carries entries, the version must exceed the baseline by SemVer precedence (1.0.0-rc1 < 1.0.0), a**Breakingentry needs a minor bump on 0.x or a major bump from 1.x, and a pre-release version refuses### Added,### Removedand**Breakingentries. Without a version it only checks that the newest released section is tagged, warning when it is not.cut: rewrites## [Unreleased]into## [X.Y.Z] - <date>, turns the[Unreleased]: .../compare/<prev>...HEADlink into the released compare link, and exportsCHANGELOG_VERSIONinto the job environment. Refuses an empty section, more than one[Unreleased]heading, or an existing[X.Y.Z]section.notes: writes the[X.Y.Z]section toout.format: plaindrops backticks and**, turns### GroupintoGroup:and leads withtitle;format: markdownkeeps the section as authored and omits the title.
| Input | Default | Description |
|---|---|---|
mode |
(required) | check, cut, or notes. |
package |
"" |
Package name (required for a workspace with more than one member). |
working-directory |
. |
Directory containing the crate or workspace. |
changelog |
CHANGELOG.md |
Changelog path, relative to the working directory. |
version |
"" |
The version, overriding Cargo.toml resolution in every mode. Required for cut on a repository without a crate; notes falls back to the newest released section. |
out |
release-notes.md |
notes: file the rendered notes are written to, relative to the working directory. |
title |
"" |
notes: subject line led before the section in plain format. |
format |
plain |
notes: plain or markdown. |
baseline-version |
"" |
check: the version the crate must exceed. Defaults to the greatest release tag in the checkout by SemVer precedence, or 0.0.0 when there is none. |
date |
"" |
cut: the date stamped on the released section (defaults to today, UTC). |
- A stable version's baseline skips
-rcNtags, since candidate markers reserve nothing; a pre-release version counts them. - The version ladder is the
versioninput, else Cargo.toml throughcargo metadata. - In
markdownformat inline code keeps@tokenssuch as@importfrom autolinking as @mentions in the release body. - SemVer compares
rc9andrc10lexically, sorc10orders belowrc9; number candidates-rc.9,-rc.10when double digits are in reach. - Build metadata (
+build) is accepted and ignored for precedence.