From 17c2fce86054ffe20f6057602d57c8833a1092ac Mon Sep 17 00:00:00 2001 From: Caio Ricciuti Date: Sat, 18 May 2024 19:22:47 +0200 Subject: [PATCH] Fix multiple re-renders of metrics page / update release worker --- .github/workflows/release.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fd2830..ca637b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 - with: - token: ${{ secrets.GHCR_PAT }} - name: Set up Git run: | @@ -24,7 +22,7 @@ jobs: run: | set -e # Fail on first error - # Extract the latest tag, or default to v1.0.0 + # Extract the latest tag, or default to v1.0.0 if no tags exist latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` || echo "v1.0.0") echo "Latest tag: $latest_tag" echo "latest_tag=$latest_tag" >> $GITHUB_ENV @@ -41,6 +39,24 @@ jobs: echo "New tag: $new_tag" echo "new_tag=$new_tag" >> $GITHUB_ENV + - name: Check if tag exists + id: tag_check + run: | + set -e # Fail on first error + + if git rev-parse "refs/tags/${{ env.new_tag }}" >/dev/null 2>&1; then + echo "Tag already exists." + + # Increment the minor version instead + new_minor=$((minor + 1)) + new_patch=0 + new_tag="v$major.$new_minor.$new_patch" + echo "New incremented tag: $new_tag" + echo "new_tag=$new_tag" >> $GITHUB_ENV + else + echo "Tag does not exist." + echo "new_tag=$new_tag" >> $GITHUB_ENV + - name: Create new tag run: | set -e # Fail on first error