-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support conventional commits #31
Conversation
action.yml
Outdated
@@ -30,13 +30,23 @@ inputs: | |||
description: 'Use the GitHub API to discover current tags, which avoids the need for a git checkout, but requires `curl` and `jq`' | |||
required: false | |||
default: false | |||
conventional_commits: | |||
description: | | |||
Will parse the last commit message to determine the increment type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should be noted that it can't be used in conjunction with calver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have this as part of the scheme? so that the scheme options become: semver
, calver
, conventional_commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or potentially as part of the increment input? so that its options become major
, minor
, patch
, commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of it being a different scheme.
Avoids it being in conflict calver
for free.
shared.sh
Outdated
echo "🛑 Value of 'conventional_commits' is not valid, choose from 'false' or 'true'" 1>&2 | ||
input_errors='true' | ||
fi | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional safety check for calver
+ conventional_commits = true
?
680fdb0
to
a449b75
Compare
action.yml
Outdated
`conventional_commits` Will parse the last commit message to determine the increment type. | ||
Supports the following increment types: | ||
- patch (build, chore, ci, docs, fix, perf, refactor, revert, style, test) | ||
- minor (feat) | ||
- Major (any of the above types with an '!' or 'BREAKING CHANGE:' in commit body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting ... it only parses the last commit 🤔
This means the consumer of this action have to ensure to remember to have to correct keyword in the merge commit (if using merge commits)
I wonder how other tooling does this? e.g. https://semantic-release.gitbook.io/semantic-release
I wonder if this action should parse every commit between "this" commit, and the "current version" tag commit ?
--
I realised the above, because I wanted to rewrite this description to be:
`conventional_commits` Will parse the last commit message to determine the increment type. | |
Supports the following increment types: | |
- patch (build, chore, ci, docs, fix, perf, refactor, revert, style, test) | |
- minor (feat) | |
- Major (any of the above types with an '!' or 'BREAKING CHANGE:' in commit body) | |
`conventional_commits` will parse the commit messages to determine the increment digit for a `semver` version (and implies `semver` scheme) | |
Supports the following increment types: | |
- patch (build, chore, ci, docs, fix, perf, refactor, revert, style, test) | |
- minor (feat) | |
- major (any of the above types with an '!' or 'BREAKING CHANGE:' in commit body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... guess this isn't as straight forward 😅
Either this would imply that merge commits would have to follow the same convention to correctly increment the version.
Or like you said, parse every commit since the last version and work out what increment type the version to jump to. That sounds more 'right' to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Harder to do in bash though 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the idea @XenoSnowFox
Thanks for the inplementation @DanielAtanasovski
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [reecetech/version-increment](https://togithub.com/reecetech/version-increment) | action | major | `2023.10.2` -> `2024.4.1` | --- ### Release Notes <details> <summary>reecetech/version-increment (reecetech/version-increment)</summary> ### [`v2024.4.1`](https://togithub.com/reecetech/version-increment/releases/tag/2024.4.1) [Compare Source](https://togithub.com/reecetech/version-increment/compare/2023.10.2...2024.4.1) #### What's Changed - Support conventional commits by [@​DanielAtanasovski](https://togithub.com/DanielAtanasovski) in [https://github.com/reecetech/version-increment/pull/31](https://togithub.com/reecetech/version-increment/pull/31) #### New Contributors - [@​DanielAtanasovski](https://togithub.com/DanielAtanasovski) made their first contribution in [https://github.com/reecetech/version-increment/pull/31](https://togithub.com/reecetech/version-increment/pull/31) **Full Changelog**: reecetech/version-increment@2023.10.2...2024.4.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
Adds a new action input
conventional_commits
, that when enabled, will parse the HEAD commit for keywords that will influence the increment type (patch, minor, major).Only supports the keywords
feat:
andfix:
as well as their scoped (feat(some-scope):
) and breaking change (feat!:
) variations.Also supports
BREAKING CHANGE:
in the body of the commit for amajor
increment.These are defaults outlined in the spec. Adding further commit types is a simple as adding another regular expression into the regex array.
Resolves #28