From 14d065673dceaaca14231d7c1ebad822b587e169 Mon Sep 17 00:00:00 2001
From: meihaiyi <haiyi.mei@qq.com>
Date: Tue, 6 Aug 2024 03:15:58 +0800
Subject: [PATCH] chore: Update CircleCI pipeline to clone and checkout branch
 or tag using bash

---
 .circleci/continue_config.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.circleci/continue_config.yml b/.circleci/continue_config.yml
index d74483d3..110cdad3 100644
--- a/.circleci/continue_config.yml
+++ b/.circleci/continue_config.yml
@@ -37,7 +37,8 @@ jobs:
                 command: |
                   TAG="<< pipeline.git.tag >>"
                   BRANCH="<< pipeline.git.branch >>"
-                  if [ -n "$TAG" ]; then
+                  # If the branch is empty, use the tag as the branch
+                  if [ -z "$BRANCH" ] || [ "$BRANCH" = " " ]; then
                     BRANCH=$TAG
                   fi
                   echo "Cloning $BRANCH branch"