feat(release): configure when all branches should be checked for a matching releaseTagPattern #30044
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.
Current Behavior
We always check the current branch for matches for
releaseTagPattern
and use the latest one of those as the source of truth. We only fall back to checking all branches in case of no matches on the current branch.In some workflows (e.g. with hotfix branches that received tags getting merged back into trunk) this can lead to an undesired match (because the desired tag was not applied to the trunk branch when the hotfix branch was merged).
Expected Behavior
There is a new
releaseTagPatternCheckAllBranchesWhen
which controls this behaviour, leaving the default (i.e. the option is undefined) unchanged.To change the above default behaviour you can:
"releaseTagPatternCheckAllBranchesWhen": true
which means that we should always check all branches for the latest match for "releaseTagPattern""releaseTagPatternCheckAllBranchesWhen": true
which means that we should never check all branches for the latest match for "releaseTagPattern", i.e. if the check for a match on the current branch fails to find anything, there is no longer any fallback"releaseTagPatternCheckAllBranchesWhen": string[]
where each string entry is either a branch name or a glob pattern to match against branch names. In this case we will check all branches (instead of just the current branch) when the current branch matches one of the entries in the array. In other words it's similartrue
but for a configured subset of current branchesRelated Issue(s)
Fixes #