Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ jobs:
if: github.event_name == 'pull_request'
run: echo "SNAPSHOT_SUFFIX=-pr-${{ github.event.number }}" >> $GITHUB_ENV

- name: Check for existing release tag (only on PR)
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ env.VERSION }}
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
# fixme restore this, it is temporary
# - name: Check for existing release tag (only on PR)
# if: github.event_name == 'pull_request'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# VERSION: ${{ env.VERSION }}
# 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
Expand Down