diff --git a/script/build/sync_repo.sh b/script/build/sync_repo.sh index 273458f10..1a6ea4ed6 100755 --- a/script/build/sync_repo.sh +++ b/script/build/sync_repo.sh @@ -10,7 +10,17 @@ if echo $CI_BUILD_REF_NAME | grep private; then fi git checkout $CI_BUILD_REF_NAME -git pull --rebase origin $CI_BUILD_REF_NAME -if git remote | grep github > /dev/null; then git remote rm github; fi +if [ "$CI_BUILD_REF_NAME" != "$CI_BUILD_TAG" ]; then + git pull --rebase origin $CI_BUILD_REF_NAME +fi + +if git remote | grep github > /dev/null; then + git remote rm github +fi git remote add github $GITHUB_DEST -git push github $CI_BUILD_REF_NAME + +if [ "$CI_BUILD_REF_NAME" != "$CI_BUILD_TAG" ]; then + git push github $CI_BUILD_REF_NAME +else + git push github --tags +fi