From ec02a77c190cd48838c1be40fb1d84432e179b65 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:11:03 -0400 Subject: [PATCH] Add tag cleaner script to help with changelog issues --- .github/workflows/release.yml | 2 ++ scripts/tagcleaner.sh | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 scripts/tagcleaner.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9616c583..57f887d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,8 @@ jobs: with: distribution: 'temurin' java-version: 17 + - name: Remove tags for release on other versions + run: ./scripts/tagcleaner.sh - name: Build and publish mod to CurseForge & Modrinth run: | chmod +x gradlew diff --git a/scripts/tagcleaner.sh b/scripts/tagcleaner.sh new file mode 100755 index 00000000..97d541ba --- /dev/null +++ b/scripts/tagcleaner.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# if current tag is 5.2.3+1.16.5, strip all other 5.2.3+* tags +current_tag=$(git describe --tags --abbrev=0) +current_tag_prefix=$(echo $current_tag | sed 's/+.*/+/g') + +git tag | while read -r other_tag; do + if [ "x$other_tag" != "x$current_tag" ] ; then + if [[ $other_tag == ${current_tag_prefix}* ]]; then + git tag -d $other_tag + fi + fi +done \ No newline at end of file