From cb00f3a5dbed5426d83f9a4722823a65d75ec0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Borov=C4=8Danin?= Date: Tue, 11 Jun 2024 12:12:09 +0200 Subject: [PATCH] NOISSUE - Fix CI to fetch tags (#2282) Signed-off-by: Dusan Borovcanin --- .github/workflows/build.yml | 4 ++++ Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b63e2a7365..ff811a264b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Fetch tags for the build + run: | + git fetch --prune --unshallow --tags + - name: Install Go uses: actions/setup-go@v5 with: diff --git a/Makefile b/Makefile index d3808909d3..eadc28afa1 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ DOCKERS = $(addprefix docker_,$(SERVICES)) DOCKERS_DEV = $(addprefix docker_dev_,$(SERVICES)) CGO_ENABLED ?= 0 GOARCH ?= amd64 -VERSION ?= $(shell git describe --abbrev=0 --tags) +VERSION ?= $(shell git describe --abbrev=0 --tags 2>/dev/null || echo 'unknown') COMMIT ?= $(shell git rev-parse HEAD) TIME ?= $(shell date +%F_%T) USER_REPO ?= $(shell git remote get-url origin | sed -e 's/.*\/\([^/]*\)\/\([^/]*\).*/\1_\2/' )