From bee1136fd4da96affa4049dc0694cfe7d9d34be0 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Sat, 19 Jul 2025 13:12:54 +0300 Subject: [PATCH] fix getting git tag --- podman_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podman_push.sh b/podman_push.sh index d61b445..6dd7c5a 100755 --- a/podman_push.sh +++ b/podman_push.sh @@ -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