perf(tools): avoid initialization interruption in single branch forks (#992)

This commit is contained in:
Cotes 2023-04-17 02:40:25 +08:00 committed by GitHub
parent 6f6e309741
commit e90461aa3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,9 +77,9 @@ check_env() {
_check_init _check_init
} }
checkout_latest_tag() { checkout_latest_release() {
tag=$(git describe --tags "$(git rev-list --tags --max-count=1)") hash=$(git log --grep="chore(release):" -1 --pretty="%H")
git reset --hard "$tag" git reset --hard "$hash"
} }
init_files() { init_files() {
@ -114,7 +114,7 @@ commit() {
main() { main() {
check_env check_env
checkout_latest_tag checkout_latest_release
init_files init_files
commit commit
} }