Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 925fa8f

Browse files
committed
fix(build): check for existing tag on remote branch instead of local
1 parent e2d77e4 commit 925fa8f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

scripts/semantic-release/_release-all.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,24 @@ add_bump_tag()
2929
echo "*** Adding version bump tag"
3030
cd $BUILD_DIR
3131

32-
# Add tag to kick off version bump
32+
# Fetch remote repo and checkout branch
3333
git fetch $1 $2:$3 # <remote-branch>:<local-branch>
3434
check $? "git fetch failure"
3535
git checkout $3
36+
37+
# Check if release tag exists
38+
git tag | grep "^$RELEASE_TAG_PREFIX$VERSION$"
39+
if [ $? -eq 0 ]; then
40+
check 1 "Tag $RELEASE_TAG_PREFIX$VERSION exists. Do not release!"
41+
fi
42+
43+
# Check if bump tag exists (i.e., if build has already been started)
44+
git tag | grep "^$BUMP_CHAIN_TAG_PREFIX$VERSION$"
45+
if [ $? -eq 0 ]; then
46+
check 1 "Tag $BUMP_CHAIN_TAG_PREFIX$VERSION exists. Do not release!"
47+
fi
48+
49+
# Add tag to kick off version bump
3650
git tag $BUMP_CHAIN_TAG_PREFIX$VERSION -f
3751
git push $1 tag $BUMP_CHAIN_TAG_PREFIX$VERSION
3852
check $? "git push tag failure"
@@ -60,11 +74,6 @@ prereqs()
6074
sed 's|\"||g' | \
6175
sed 's|,||g' | \
6276
sed 's| *||g'`
63-
64-
git tag | grep "^$RELEASE_TAG_PREFIX$VERSION$"
65-
if [ $? -eq 0 ]; then
66-
check 1 "Tag $RELEASE_TAG_PREFIX$VERSION exists. Do not release!"
67-
fi
6877
}
6978

7079
usage()

0 commit comments

Comments
 (0)