From 776c65805296e280cc8dd2ce4f611e6d06fa62ee Mon Sep 17 00:00:00 2001 From: JerrettDavis Date: Fri, 27 Mar 2026 12:26:21 -0500 Subject: [PATCH] fix(ci): check remote tags before pushing release tag --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6afd46..e724219 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,11 +212,13 @@ jobs: set -euo pipefail git config user.name "github-actions" git config user.email "github-actions@github.com" - if git rev-parse "v${PACKAGE_VERSION}" >/dev/null 2>&1; then - echo "Tag v${PACKAGE_VERSION} already exists. Skipping tag push." + TAG="v${PACKAGE_VERSION}" + + if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then + echo "Tag ${TAG} already exists on origin. Skipping tag push." else - git tag "v${PACKAGE_VERSION}" - git push origin "v${PACKAGE_VERSION}" + git tag "${TAG}" + git push origin "${TAG}" fi - name: Create GitHub Release