From 5764af75f776c9239a2437cd6d98fc951109e32a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 4 Aug 2026 00:32:04 +0000 Subject: [PATCH] fix: stop the duplicate-release guard from failing when it passes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `gh release view` exits 1 when the release does not exist — which is the case the guard is written to allow — and the runner ends every pwsh step with `exit $LASTEXITCODE`. So the step inherited that 1 and failed the release run at precisely the moment the check had succeeded. It printed "v1.1.3 is free" and then failed, which is as clear a statement of the bug as any. The check itself was right and the ordering saved the run: nothing was built, no tag was created and nothing was published. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KqeMPekXsH3e1tSgJkWYyz --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90f44f9..ab147ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,10 +79,16 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh release view $env:RELEASE_TAG 2>$null + $ErrorActionPreference = 'Continue' + gh release view $env:RELEASE_TAG --json tagName 2>$null | Out-Null if ($LASTEXITCODE -eq 0) { throw "Release $env:RELEASE_TAG already exists" } Write-Host "$env:RELEASE_TAG is free" + # "Not found" leaves $LASTEXITCODE at 1, and the runner ends every + # pwsh step with `exit $LASTEXITCODE` — so without this the step + # fails precisely when the check has passed. + exit 0 + - name: Build release packages shell: pwsh run: ./build-release.ps1