From 3ebe60785c44e0d26203d9afd33a5939ccbdf6e3 Mon Sep 17 00:00:00 2001 From: Kacper Kula Date: Thu, 22 May 2025 14:23:55 +0100 Subject: [PATCH] chore: adding checks to skip when version exists --- scripts/tag-and-publish.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/tag-and-publish.sh b/scripts/tag-and-publish.sh index 8ab57a7..370f0d0 100755 --- a/scripts/tag-and-publish.sh +++ b/scripts/tag-and-publish.sh @@ -24,6 +24,27 @@ fi echo "Processing version: $version" + +# Check if tag already exists locally +if git tag -l | grep -q "^$version$"; then + echo "Error: Git tag '$version' already exists locally" + exit 1 +fi + +# Check if tag exists on remote +if git ls-remote --tags origin | grep -q "refs/tags/$version$"; then + echo "Error: Git tag '$version' already exists on remote" + exit 1 +fi + +# Check if GitHub release already exists +if gh release view "$version" >/dev/null 2>&1; then + echo "Error: GitHub release '$version' already exists" + exit 1 +fi + +echo "Version checks passed - proceeding with release creation" + # Get Release Notes awk -v version="$version" ' BEGIN { found=0; content="" }