Fixing get version same commit
This commit is contained in:
14
action.yml
14
action.yml
@@ -20,9 +20,18 @@ runs:
|
||||
|
||||
if [[ -n "${SEMVER_UPDATE}" ]]; then
|
||||
git fetch --tags --force
|
||||
|
||||
last_version="$(git describe --tags --abbrev=0 --match "v*" 2> /dev/null || echo "")"
|
||||
if [[ -z "$last_version" ]]; then
|
||||
|
||||
if git tag --points-at HEAD | grep -q "^${last_version}"; then
|
||||
log_info "A tag already exists on the current commit, using it"
|
||||
NEW_VERSION="${last_version:1}"
|
||||
|
||||
else
|
||||
|
||||
git fetch --tags --force
|
||||
git describe --tags --abbrev=0 --match "v*"
|
||||
|
||||
if [[ -z "${last_version}" ]]; then
|
||||
last_version="v0.0.0"
|
||||
fi
|
||||
last_version="${last_version:1}"
|
||||
@@ -42,6 +51,7 @@ runs:
|
||||
esac
|
||||
|
||||
log_info "Requested ${SEMVER_UPDATE} update"
|
||||
fi;
|
||||
|
||||
NEW_VERSION="v${NEW_VERSION}"
|
||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||
|
||||
Reference in New Issue
Block a user