fix getting git tag

This commit is contained in:
Antonio J. Delgado 2025-07-19 13:12:54 +03:00
parent 8f8868c0cc
commit bee1136fd4

View file

@ -3,7 +3,7 @@ script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
repo="$(basename "${script_dir}")"
tag="${1}"
if [ -z "${tag}" ]; then
git_reference=$(grep '^ref: ' .git/HEAD | awk 'BEGIN {FS="/"} {print($NF)}')
git_reference=$(git describe --exact-match --tags)
if [ "${git_reference}" == 'master' ] || [ "${git_reference}" == 'main' ] || [ -z "${git_reference}" ]; then
echo "Change to a different git reference not 'master/main', since it will be used as tag for the container. Or pass a tag name as only parameter."
exit 1