From daf9723c28310b33a07b2ff51a12cc8319d2ed71 Mon Sep 17 00:00:00 2001 From: Roger Miret Date: Mon, 9 Feb 2026 09:58:57 +0100 Subject: [PATCH] ci: restore PR release tag validation step --- .github/workflows/release.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4e5092f..681e7b79 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,20 +38,19 @@ jobs: if: github.event_name == 'pull_request' run: echo "SNAPSHOT_SUFFIX=-pr-${{ github.event.number }}" >> $GITHUB_ENV - # todo: this is temporary, should be restored - # - name: Check for existing release tag (only on PR) - # if: github.event_name == 'pull_request' - # env: - # VERSION: ${{ env.VERSION }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # TAG_EXISTS=$(curl -H "Authorization: token $GITHUB_TOKEN" -s https://api.github.com/repos/${{ github.repository }}/releases | jq -r ".[] | select(.tag_name == \"v$VERSION\") | .tag_name") - # if [ "$TAG_EXISTS" == "v$VERSION" ]; then - # echo "Release tag v$VERSION already exists. Rejecting PR." - # exit 1 - # else - # echo "No existing release with tag v$VERSION found. Proceeding with build." - # fi + - name: Check for existing release tag (only on PR) + if: github.event_name == 'pull_request' + env: + VERSION: ${{ env.VERSION }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_EXISTS=$(curl -H "Authorization: token $GITHUB_TOKEN" -s https://api.github.com/repos/${{ github.repository }}/releases | jq -r ".[] | select(.tag_name == \"v$VERSION\") | .tag_name") + if [ "$TAG_EXISTS" == "v$VERSION" ]; then + echo "Release tag v$VERSION already exists. Rejecting PR." + exit 1 + else + echo "No existing release with tag v$VERSION found. Proceeding with build." + fi # Logins - name: Login to Docker Hub