fix: fall back to git tag on HEAD when version input is not propagated
All checks were successful
Push Validation / validate (push) Successful in 1m43s

This commit is contained in:
Micheal Wilkinson
2026-03-20 22:46:44 +00:00
parent 87059d21fd
commit 4c5a49d685

View File

@@ -52,6 +52,9 @@ runs:
elif [[ "${GITHUB_REF_VALUE}" == refs/tags/* ]]; then elif [[ "${GITHUB_REF_VALUE}" == refs/tags/* ]]; then
tag="${GITHUB_REF_VALUE#refs/tags/}" tag="${GITHUB_REF_VALUE#refs/tags/}"
normalized="${tag#v}" normalized="${tag#v}"
elif head_tag="$(git describe --exact-match --tags HEAD 2>/dev/null)" && [[ -n "$head_tag" ]]; then
tag="$head_tag"
normalized="${tag#v}"
else else
echo "A version input is required when the workflow is not running from a tag push" >&2 echo "A version input is required when the workflow is not running from a tag push" >&2
exit 1 exit 1