From 5aaf6c7537b6e813aaeea51a9fe6aea4dc781094 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Thu, 4 May 2023 09:12:43 +0000 Subject: [PATCH] Squashed '.ci/' changes from a5875db..aea1ccc aea1ccc Only add branch name to tags, if not part of actual tag git-subtree-dir: .ci git-subtree-split: aea1cccfff35de2ef2eca138379a599c8bde39e0 --- podman.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/podman.mk b/podman.mk index d9f79b9..b4b086e 100644 --- a/podman.mk +++ b/podman.mk @@ -2,11 +2,15 @@ GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) GIT_TAG := $(shell git describe --tags --match v*.*.* 2>/dev/null || git rev-parse --short HEAD 2>/dev/null) -# append branch name to tag if NOT main nor master TAG := $(GIT_TAG) +# append branch name to tag if NOT main nor master ifeq (,$(filter main master, $(GIT_BRANCH))) - ifneq ($(GIT_TAG), $(GIT_BRANCH)) - TAG = $(GIT_TAG)-$(GIT_BRANCH) + # If branch is substring of tag, omit branch name + ifeq ($(findstring $(GIT_BRANCH), $(GIT_TAG)),) + # only append branch name if not equal tag + ifneq ($(GIT_TAG), $(GIT_BRANCH)) + TAG = $(GIT_TAG)-$(GIT_BRANCH) + endif endif endif