Current behaviour: On merge to a release branch the tag is bumped via #major/#minor/#patch tokens or DEFAULT_BUMP. With GitFlow-style release/X.Y.Z branches, the exact version is already decided by the branch name, yet a patch release still requires a manual #patch in the merge commit — and forgetting it silently produces a wrong (minor) tag.
Proposed enhancement: An opt-in TAG_FROM_BRANCH (default false) that takes the tag verbatim from the version embedded in the branch name — read from the merge/squash commit message, falling back to the current branch name. A configurable BRANCH_VERSION_REGEX (default release[/-]([0-9]+\.[0-9]+\.[0-9]+)) extracts the version. If no version is recoverable (e.g. a rebase-merge dropped the branch name) the action fails loudly instead of mis-tagging. CUSTOM_TAG keeps precedence; the WITH_V/TAG_PREFIX prefix is applied.
Why it helps most users: branch-name-driven versioning is a common pattern (GitFlow, release-please, GitVersion). It's fully opt-in (no change to existing workflows) and the regex is user-configurable, so it isn't tied to any one branch convention. Matching is done with bash [[ =~ ]]/BASH_REMATCH — no shell-injection surface from commit text.
Happy to open a PR (entrypoint.sh + README + bats tests) if this fits the project's scope.
Current behaviour: On merge to a release branch the tag is bumped via
#major/#minor/#patchtokens orDEFAULT_BUMP. With GitFlow-stylerelease/X.Y.Zbranches, the exact version is already decided by the branch name, yet a patch release still requires a manual #patch in the merge commit — and forgetting it silently produces a wrong (minor) tag.Proposed enhancement: An opt-in
TAG_FROM_BRANCH(defaultfalse) that takes the tag verbatim from the version embedded in the branch name — read from the merge/squash commit message, falling back to the current branch name. A configurableBRANCH_VERSION_REGEX(defaultrelease[/-]([0-9]+\.[0-9]+\.[0-9]+)) extracts the version. If no version is recoverable (e.g. a rebase-merge dropped the branch name) the action fails loudly instead of mis-tagging.CUSTOM_TAGkeeps precedence; theWITH_V/TAG_PREFIXprefix is applied.Why it helps most users: branch-name-driven versioning is a common pattern (GitFlow, release-please, GitVersion). It's fully opt-in (no change to existing workflows) and the regex is user-configurable, so it isn't tied to any one branch convention. Matching is done with bash
[[ =~ ]]/BASH_REMATCH— no shell-injection surface from commit text.Happy to open a PR (entrypoint.sh + README + bats tests) if this fits the project's scope.