From c4e8ba6104d055270621da71cff9245c991ffb54 Mon Sep 17 00:00:00 2001 From: Dablakbandit Date: Sat, 30 Nov 2024 10:28:43 +1300 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9d1fe183..3472c54ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,8 +65,21 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const { owner, repo } = context.repo - await github.repos.deleteRelease({ owner, repo, release_id: 'patreon' }) + const { owner, repo } = context.repo; + try { + const release = await github.repos.getReleaseByTag({ + owner, + repo, + tag: 'patreon' + }); + await github.repos.deleteRelease({ + owner, + repo, + release_id: release.data.id + }); + } catch (error) { + console.log('No existing release found with tag patreon'); + } - name: Upload Patreon Release uses: ncipollo/release-action@v1