Clone the latest tag, instead of cloning master branch

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-09-25 22:00:09 +05:30
parent daab42d905
commit 83e2a9b1ba
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -1,8 +1,8 @@
#!/bin/sh
BASE_DIR=$(pwd)
git clone https://${CONTENT_REPO_USERNAME}:${CONTENT_REPO_TOKEN}@git.baalajimaestro.me/baalajimaestro/${CONTENT_REPO_GIT} content
REPO="https://${CONTENT_REPO_USERNAME}:${CONTENT_REPO_TOKEN}@git.baalajimaestro.me/baalajimaestro/${CONTENT_REPO_GIT}"
git clone "$REPO" -b $(git ls-remote --tags --refs "$REPO" | tail -n1 | cut -d/ -f3) content
rm -rf content/.obsidian
rm -rf content/.gitlab-ci.yml