publish
This Action automates generating a release by automatically generating release notes based on the commits that make up the release.
It was inspired by marvinpinto's action-automatic-releases,
which is now archived, adapted to how I typically used that Action.
Release Notes
This action takes all commits between the new tag (head
) and the previous release (either manually specified in the base
tag,
or by walking through the previous commits until we find another tag). If the commit message follows the Conventional Commits
standard, those commits are grouped in the release notes. Otherwise, the commit is listed under a generic 'Commits' section.
This action understands the following categories for a conventional commit:
Keyword |
Title |
feat |
Features |
fix |
Bug Fixes |
doc |
Documentation |
refactor |
Refactoring |
test |
Testing |
perf |
Performance |
ci |
Continuous Integration |
build |
Build |
chore |
Chores |
style |
Style |
The Action also understand the 'breaking change' indicator, so a commit message feat!: new feature
is displayed as follows:
Features
- ⚠️ Breaking Change: new feature
Note: the Action only considers the first line of a commit. Subsequent lines are discarded.
Running the Action
Supported parameters
Parameter |
Description |
Type |
Default |
github_token * |
GitHub token for authentication |
string |
N/A |
head |
tag name of the new release |
string |
none |
base |
tag name of the previous release |
string |
none |
publish |
if true, the release is created |
boolean |
true |
draft |
mark the release as 'draft' |
boolean |
false |
prerelease |
mark the release as a 'prerelease' |
boolean |
false |
Notes:
*
indicates a mandatory parameter
- if
head
is omitted, the action uses the tag that was pushed to trigger this action to create the release notes.
- if
base
is omitted, the action includes all commitments up to the previously tagged commit for the release notes.
- if
publish
is false, the release is not created. The release notes, however, are available in the output values.
Output
Parameter |
Description |
Type |
release |
tag name of the new release, if created |
string |
release-notes |
release notes, based on the included commits |
string |