Skip to content

Commit 5e2240d

Browse files
authored
fix: remove tag annotation from version (#1303)
* fix: remove tag annotation from version * update regex
1 parent 3d88b18 commit 5e2240d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tooling/build/scripts/preBuild.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ if [ -z "$ISOMER_BUILD_REPO_BRANCH" ]; then
1919
# --sort='v:refname': Sorts the tags by version number according to the semantic versioning scheme
2020
# tail -n1: Gets the last line of the output.
2121
# awk '{print $2}': Prints the second column of the last line, which is the tag name.
22-
# sed 's/refs\/tags\///': Removes the 'refs/tags/' prefix from the tag name.
23-
ISOMER_BUILD_REPO_BRANCH=$(git ls-remote --tags --sort='v:refname' https://github.com/opengovsg/isomer.git | tail -n1 | awk '{print $2}' | sed 's/refs\/tags\///')
22+
# sed -E 's|refs/tags/||; s/\^.*$//': Removes the 'refs/tags/' prefix from the tag name.
23+
# - If tag is annotated (maybe due to signing), the tag name will have a caret (^) and optional text after it.
24+
ISOMER_BUILD_REPO_BRANCH=$(git ls-remote --tags --sort='v:refname' https://github.com/opengovsg/isomer.git | tail -n1 | awk '{print $2}' | sed -E 's|refs/tags/||; s/\^.*$//')
2425
fi
2526

2627
# Store the current directory

tooling/build/scripts/publisher.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ if [ -z "$ISOMER_BUILD_REPO_BRANCH" ]; then
1919
# --sort='v:refname': Sorts the tags by version number according to the semantic versioning scheme
2020
# tail -n1: Gets the last line of the output.
2121
# awk '{print $2}': Prints the second column of the last line, which is the tag name.
22-
# sed 's/refs\/tags\///': Removes the 'refs/tags/' prefix from the tag name.
23-
ISOMER_BUILD_REPO_BRANCH=$(git ls-remote --tags --sort='v:refname' https://github.com/opengovsg/isomer.git | tail -n1 | awk '{print $2}' | sed 's/refs\/tags\///')
22+
# sed -E 's|refs/tags/||; s/\^.*$//': Removes the 'refs/tags/' prefix from the tag name.
23+
# - If tag is annotated (maybe due to signing), the tag name will have a caret (^) and optional text after it.
24+
ISOMER_BUILD_REPO_BRANCH=$(git ls-remote --tags --sort='v:refname' https://github.com/opengovsg/isomer.git | tail -n1 | awk '{print $2}' | sed -E 's|refs/tags/||; s/\^.*$//')
2425
IS_USING_RELEASE_TAG=true
2526
fi
2627

0 commit comments

Comments
 (0)