Github Conventional Commit Release
Github Conventional Commit Release¶
Description¶
This GitHub Action is designed to automate the process of creating a new release on push to the main branch. It's triggered on a pull_request closed event to the main branch and does not require any inputs.
However, it requires specific naming convention for the commit message in order to release the right version.
The release automatically increases the patch, minor or major version, but also tags the MAJOR and MAJOR.MINOR versions to point to the latest commit.
The workflow pays attention to the title of the latest commit and check what it starts with. Which means that when squashing and merging your PR, you need to add the proper key words.
The options are:
- "fix: Some comment" -> will increment the patch version x.x.PATCH+1
- "feat: Some comment" -> will increment the minor version x.MINOR+1.0
- "feat!: Some comment" -> will increment the major version MAJOR+1.0.0
Inputs¶
name | description | type | required | default |
---|---|---|---|---|
metadata_file |
File path containing the extra metadata to append to the release version, if not specified the standard semver is applied |
string |
false |
"" |
Usage¶
jobs:
job1:
uses: tx-pts-dai/github-workflows/.github/workflows/gh-release-on-main.yaml@v2
with:
metadata_file:
# File path containing the extra metadata to append to the release version, if not specified the standard semver is applied
#
# Type: string
# Required: false
# Default: ""
Example¶
-
we currently are at version v1.1.1. . Squashing/merging a PR with a "fix:" prefix will increase the patch version (-> v1.1.2), and also will renew tagging so that workflows already calling @v1 or @v1.1 would target the new release v1.1.2.
-
we currently are at version v1.1.9. Squashing/merging a PR with a "feat:" prefix will increase the minor version (-> v1.2.0), and also will renew tagging so that workflows already calling @v1 or @v1.2 would target the new release v1.2.0.
FAQ¶
Q: How is the version number determined?
A: The version number is determined by fetching all tags, sorting them, and retrieving the latest version. If no tags are found, it defaults to v0.0.1.
Q: How are the release notes generated?
A: The release notes are automatically generated by the softprops/action-gh-release@v1
action.