From 3bf3fd9a46b2f42e26dd4d819116853775c62493 Mon Sep 17 00:00:00 2001 From: VillagerTom Date: Wed, 21 Feb 2024 13:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=8F=82=E6=95=B0`fetch-dept?= =?UTF-8?q?h:=200`=E5=8F=96=E5=BE=97=E6=89=80=E6=9C=89=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=92=8Ctags,=20=E6=9C=AB=E7=AB=AF=E6=8F=90=E4=BA=A4=E6=94=B9?= =?UTF-8?q?=E5=9B=9EHEAD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alpha.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 922c6ef5..9d0b4ed8 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -26,18 +26,19 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} + fetch-depth: 0 - name: 获取first parent commit次数 id: get-first-parent-commit-count run: | version=$(yq e .version pubspec.yaml | cut -d "+" -f 1) - git fetch origin "refs/tags/*:refs/tags/*" recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true) if [[ "x$recent_release_tag" == "x" ]]; then echo "当前版本tag不存在,请手动生成tag." exit 1 fi - first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..FETCH_HEAD) + git log --oneline --first-parent $recent_release_tag..HEAD + first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD) echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT - name: 更新版本号