Skip to content

Commit 07037b2

Browse files
committed
fix release branch detection for tag builds
1 parent 5ed8137 commit 07037b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ jobs:
224224
else
225225
if [[ -z $CIRCLE_BRANCH ]]; then
226226
BRANCHES=$(git branch -a --contains tags/$CIRCLE_TAG)
227-
CIRCLE_BRANCH=${BRANCHES##*/}
227+
CIRCLE_BRANCH=$(echo "$BRANCHES" | grep -Eo '(release/v[0-9]+\.[0-9]+(\.[0-9]+)?$|main$)' | head -n1)
228+
CIRCLE_BRANCH=${CIRCLE_BRANCH:-${BRANCHES##*/}}
228229
echo "CIRCLE_BRANCH is empty, trying to set it from git, result: $CIRCLE_BRANCH"
229230
fi
230231
if [[ $CIRCLE_BRANCH != "main" && \

0 commit comments

Comments
 (0)