From 10f240daadfe86041c84153b7a8eae0c46e8f6af Mon Sep 17 00:00:00 2001 From: remsky Date: Fri, 4 Apr 2025 19:38:27 -0600 Subject: [PATCH] Add tag existence check in release workflow --- .github/workflows/release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4554796..395d218 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,8 +38,23 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Needed to check for existing tags - - name: Free disk space # Optional: Keep if needed for large builds + - name: Check if tag already exists + run: | + TAG_NAME="${{ needs.prepare-release.outputs.version_tag }}" + echo "Checking for existing tag: $TAG_NAME" + # Fetch tags explicitly just in case checkout didn't get them all + git fetch --tags + if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then + echo "::error::Tag $TAG_NAME already exists. Please increment the version in the VERSION file." + exit 1 + else + echo "Tag $TAG_NAME does not exist. Proceeding with release." + fi + + - name: Free disk space # Optional: Keep as needed for large builds run: | echo "Listing current disk space" df -h