Skip to content

Commit 9398c83

Browse files
authored
fix: Detect if custom CLI_VERSION is a tag or branch (#135)
1 parent 719dec4 commit 9398c83

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ runs:
270270
elif [ -n "${CLI_VERSION}" ]; then
271271
CLI_VERSION_TAG="${CLI_VERSION}"
272272
REPO_TAG="${CLI_VERSION}"
273-
VERIFY_FLAG="--source-tag"
273+
if [[ "${CLI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
274+
VERIFY_FLAG="--source-tag"
275+
else
276+
VERIFY_FLAG="--source-branch"
277+
fi
274278
else
275279
REPO_TAG=$(curl -fLsS --variable '%AUTH_HEADER' --expand-header '{{AUTH_HEADER}}' --retry 5 https://api.github.com/repos/blue-build/cli/tags | jq -r '.[0].name')
276280
CLI_VERSION_TAG="v0.9"

0 commit comments

Comments
 (0)