From e90461aa3c81633863db6a12c5924ddba33bd08e Mon Sep 17 00:00:00 2001 From: Cotes <11371340+cotes2020@users.noreply.github.com> Date: Mon, 17 Apr 2023 02:40:25 +0800 Subject: [PATCH] perf(tools): avoid initialization interruption in single branch forks (#992) --- tools/init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/init b/tools/init index af3ce76..450372a 100755 --- a/tools/init +++ b/tools/init @@ -77,9 +77,9 @@ check_env() { _check_init } -checkout_latest_tag() { - tag=$(git describe --tags "$(git rev-list --tags --max-count=1)") - git reset --hard "$tag" +checkout_latest_release() { + hash=$(git log --grep="chore(release):" -1 --pretty="%H") + git reset --hard "$hash" } init_files() { @@ -114,7 +114,7 @@ commit() { main() { check_env - checkout_latest_tag + checkout_latest_release init_files commit }