Skip to content

Commit 988ee4f

Browse files
authored
test/scripts: fix upgrade from version (projectcontour#5228)
Properly detect upgrade from version on feature branches based off release branches. Closes projectcontour#5184. Signed-off-by: Steve Kriss <[email protected]>
1 parent 4ed05fa commit 988ee4f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/scripts/get-contour-upgrade-from-version.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ elif git describe --tags --abbrev=0 | grep -q -v v1.2.0; then
1111
# Note: Contour v1.2.0 was improperly tagged on main so we
1212
# ignore it to ensure we dont hit that case here.
1313

14-
# We should be on a release branch with an existing tag.
15-
# Check the branch name and error if it does not contain release.
16-
# Tags should not be added to non-release branches.
17-
if git branch --show-current | grep -q release; then
18-
git describe --tags --abbrev=0
19-
else
20-
echo 'Error: invalid tag on branch'
21-
exit 1
22-
fi
14+
# We have a tag in our commit history, so we should
15+
# be on a release branch or a feature branch from a
16+
# release branch, with an existing tag.
17+
git describe --tags --abbrev=0
2318
else
2419
# We are on a release branch with no tag created yet, main, or some
2520
# other checkout, so just use the latest tag.

0 commit comments

Comments
 (0)