Fix to provide correct previous version when the current commit is tagged.

This commit is contained in:
Paul Hatcherian 2022-12-17 19:00:10 -06:00
parent 92bc0a8ba4
commit ba6e71e658
5 changed files with 32 additions and 4 deletions

View file

@ -54,7 +54,7 @@ class DefaultLastReleaseResolver {
// so that we will have an accurate increment (assuming the new tag is the expected one)
const command = `git for-each-ref --count=2 --sort=-v:*refname --format=%(refname:short) --merged=${current} ${refPrefixPattern}${releasePattern}`;
tag = yield (0, CommandRunner_1.cmd)(command);
tag = tag.split('\n').at(-1) || '';
tag = tag.split('\n').reverse().find(t => t !== '' && t !== currentTag) || '';
}
else {
const command = `git for-each-ref --count=1 --sort=-v:*refname --format=%(refname:short) --merged=${current} ${refPrefixPattern}${releasePattern}`;