(feat) New input: Tag search pattern #233
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
tag_search_patterninput for filtering tags by glob patternSummary
This PR adds a new input variable
tag_search_patternthat allows filtering which tags are considered when determining the version to bump. This enables the action to work properly with projects that maintain multiple major versions simultaneously, especially when such versions have different root commits.Problem
Currently, the action always considers all tags when determining the previous version to bump. For projects that maintain multiple major version branches in parallel (e.g., v1.x.x and v2.x.x), this can lead to incorrect version bumping because the action will always pick the highest semver tag regardless of which branch is being worked on.
Solution
The new
tag_search_patterninput accepts a glob pattern (e.g.,v1.*) that filters the tags to consider. When specified, only tags matching the pattern will be used to determine the previous version, allowing for proper versioning across multiple major version branches.Example Use Case
For a project with tags
v1.2.3andv2.0.1:tag_search_patternis specified, the action works as before, findingv2.0.1as the latest tagtag_search_pattern: "v1.*"is specified, the action will detectv1.2.3as the last tag and create a new tag likev1.2.4Changes
tag_search_patterninput parameter toaction.ymlgetValidTagsfunction inutils.tsto filter tags by pattern when providedminimatchdependency for glob pattern matchingTechnical Details
This enhancement allows for more flexible versioning strategies without breaking existing workflows.