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