ci/fix(seed-build): catch non-pr condition (#210)

This commit is contained in:
Kevin Yu 2023-07-13 20:55:53 +08:00 committed by GitHub
parent 39ddd480f9
commit 6dad0a2d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,16 +75,16 @@ jobs:
id: get_version
env:
REF: ${{ inputs.ref }}
PR: pr-${{ inputs.pr_number }}
run: |
date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
commit=$(echo ${REF} | cut -c1-6)
if [[ "${{ inputs.pr_build }}" == "true" ]]; then
count=$(git rev-list --count origin/main..HEAD)
version="unstable-${date}.pr-${{ inputs.pr_number }}.r${count}.${commit}"
else
count=$(git rev-list --count HEAD)
version="unstable-${date}.r${count}.${commit}"
fi
version="unstable-${date}.${PR}.r${count}.${commit}"
echo "VERSION=${version}" >> $GITHUB_OUTPUT
echo "VERSION=${version}" >> $GITHUB_ENV