Skip to content

Commit 9b524ba

Browse files
author
ccs-upstream-sync[bot]
committed
fix(sync-release-tag): improve upstream tag retrieval logic
1 parent 7815797 commit 9b524ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/sync-release-tag.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,18 @@ jobs:
4343
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444
run: |
4545
UPSTREAM_TAG=""
46+
ENV_UPSTREAM_TAG=""
4647
4748
if [ -f .ccs-fork-upstream.env ]; then
4849
# shellcheck disable=SC1091
4950
. ./.ccs-fork-upstream.env
51+
ENV_UPSTREAM_TAG="${UPSTREAM_TAG}"
5052
fi
5153
54+
UPSTREAM_TAG=$(git tag --merged HEAD --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)
55+
5256
if ! echo "${UPSTREAM_TAG}" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
53-
UPSTREAM_TAG=$(git tag --merged HEAD --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || true)
57+
UPSTREAM_TAG="${ENV_UPSTREAM_TAG}"
5458
fi
5559
5660
if [ -z "$UPSTREAM_TAG" ]; then

0 commit comments

Comments
 (0)