From 3f4141a9a67ec6227628774ffdc8ceb811fdcac3 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Fri, 12 Jun 2026 09:38:40 +0530 Subject: [PATCH] fix(ci): make GitHub release step idempotent Tag-push reruns and pre-existing releases made gh release create fail with 422, marking publish red after a successful PyPI upload. Skip when the release already exists. --- .github/workflows/publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9b92a67c..536fa746 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -374,6 +374,10 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - gh release create "$VERSION" \ - --title "v${VERSION}" \ - --generate-notes + if gh release view "$VERSION" >/dev/null 2>&1; then + echo "::notice::Release ${VERSION} already exists — skipping" + else + gh release create "$VERSION" \ + --title "v${VERSION}" \ + --generate-notes + fi