Skip to content

Commit

Permalink
use CIRCLE_TAG for checkout when build triggered with tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mkusaka committed Apr 17, 2022
1 parent 42f36b9 commit 5f51e6d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ commands:
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
TAG_OR_BRANCH="$CIRCLE_BRANCH"
if [ -n "$CIRCLE_TAG" ]; then
TAG_OR_BRANCH="$CIRCLE_TAG"
fi
if [ "<< parameters.depth >>" -gt 0 ]; then
git clone --depth << parameters.depth >> "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
git clone --depth << parameters.depth >> "$CIRCLE_REPOSITORY_URL" -b "$TAG_OR_BRANCH" .
else
git clone "$CIRCLE_REPOSITORY_URL" --branch "$CIRCLE_BRANCH" .
git clone "$CIRCLE_REPOSITORY_URL" -b "$TAG_OR_BRANCH" .
fi
jobs:
Expand Down

0 comments on commit 5f51e6d

Please sign in to comment.