We have a simple GitHubFlow workflow with feature/*
and bug/*
branches.
When things are merged to master, then the version gets bumped whatever we specify in the GitVersion.yml
file (minor/patch).
mode: Mainline
branches:
main:
regex: ^master$
tag: ''
# Increment is always the same regardless of the branch from which we are merging
increment: Minor
feature:
regex: ^feature/
tag: useBranchName
increment: Minor
source-branches:
- main
bug:
regex: ^bug/
tag: useBranchName
increment: Patch
source-branches:
- main
However, I'd like to bump the minor or patch version depending on whether we merged from a feature or bug branch.
I'm using Squashing when merging to master.
Is there a way to do this please?
Unfortunately, I was not able to increment the major, minor and patch versions based on the branch (the increment property inside each branch is ignored) so all merges to master increment the same way but with possibility to bump differently based on something added to the message e.g. Add
+f
(feature) to increment minor versions and+b
(bug) to increment patch version.