From a821d5b5c738bf1aaf75f461cb5250ebab36d543 Mon Sep 17 00:00:00 2001 From: Giona Righini Date: Thu, 15 Aug 2024 20:58:18 +0200 Subject: [PATCH] fix release alredy exists --- .github/workflows/release.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 927507a..60cb8de 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Release +name: Check New Release on: push: @@ -10,7 +10,7 @@ permissions: jobs: release: - name: Release pushed tag + name: Release on pushed Tag runs-on: ubuntu-22.04 steps: - name: Create release @@ -18,7 +18,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref_name }} run: | - gh release create "$tag" \ + gh release list --repo="$GITHUB_REPOSITORY" \ + | grep -q "$tag" && echo "Release $tag already exists" \ + || gh release create "$tag" \ --repo="$GITHUB_REPOSITORY" \ --title="$Release ${tag}" \ --generate-notes