From f7687af337d001ddbcc47b8e773f014a33faa662 Mon Sep 17 00:00:00 2001 From: "Dylan T." Date: Thu, 12 Dec 2024 13:11:48 +0000 Subject: [PATCH] Fixed draft release being created on release publish --- .github/workflows/draft-release.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 3374ff68f3..6000dd5a81 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -21,7 +21,31 @@ env: PHP_VERSION: "8.2" jobs: + skip: + name: Check whether to ignore this tag + runs-on: ubuntu-20.04 + + outputs: + skip: ${{ steps.exists.outputs.exists == 'true' }} + + steps: + - name: Check if release already exists + id: exists + env: + GH_TOKEN: ${{ github.token }} + run: | + exists=false + if [[ "${{ github.ref_type }}" == "tag" ]]; then + tag="$(echo "${{ github.ref }}" | cut -d/ -f3-)" + if gh release view "$tag" --repo "${{ github.repository }}"; then + exists=true + fi + fi + echo exists=$exists >> $GITHUB_OUTPUT + check: + needs: [skip] + if: needs.skip.outputs.skip != 'true' name: Check release uses: ./.github/workflows/draft-release-pr-check.yml