From 114247099f9fd79fbca0876247a5a1cb1510abba Mon Sep 17 00:00:00 2001 From: Sergey Nikolaev Date: Fri, 23 Oct 2026 21:46:42 +0700 Subject: [PATCH] ci: skip packaging when GitHub release already exists --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef39c8f..ac07b67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,16 @@ jobs: debug: true - name: Check if we should continue packing id: check-should-continue + env: + GH_TOKEN: ${{ github.token }} run: | + # A previous run may have already published this version. + if [[ "${{ steps.semver-tagger.outputs.target }}" == "release" ]] && + gh release view "${{ steps.semver-tagger.outputs.version }}" >/dev/null 2>&1; then + echo "Skipping packing because GitHub Release ${{ steps.semver-tagger.outputs.version }} already exists" + echo "should_continue=false" >> "$GITHUB_OUTPUT" + exit 0 + fi # Continue if version was updated, if we have the "pack" label on PR, or if target is "release" if [[ "${{ steps.semver-tagger.outputs.version_updated }}" == "true" ]]; then echo "Continuing because version was updated"