From 76b95c4abeeaf0add786c58f50025ed8a0143e36 Mon Sep 17 00:00:00 2001 From: violetc <58360096+s-yh-china@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:31:05 +0000 Subject: [PATCH] [ci skip] RemoveOldVersionTags.sh --- scripts/RemoveOldVersionTags.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/RemoveOldVersionTags.sh diff --git a/scripts/RemoveOldVersionTags.sh b/scripts/RemoveOldVersionTags.sh new file mode 100644 index 00000000..52c37623 --- /dev/null +++ b/scripts/RemoveOldVersionTags.sh @@ -0,0 +1,19 @@ +if [ $# != 1 ]; then + echo need input version + exit 1 +fi + +version=$1 +lastestTag=$(git describe --tags --abbrev=0 --match "$version-*") + +echo "$(git tag --list "$version-*")" >> tags.temp + +while read line +do + if [ $line != $lastestTag ]; then + git push origin :refs/tags/$line + #echo $line + fi +done < tags.temp + +rm tags.temp