From 9a6f9f79d1f864c9609d86fdb1c30a80fb906ac8 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 27 Nov 2024 15:16:53 +0100 Subject: [PATCH] fix(ci): handle case where no tags are present in git Modify the command to describe the latest tag to gracefully handle the scenario where no tags are available. This avoids potential errors in the script execution when the git repository is tagless, ensuring the CI pipeline runs smoothly under all circumstances. --- Release.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Release.gitlab-ci.yml b/Release.gitlab-ci.yml index ae63e1a..38b6d0e 100644 --- a/Release.gitlab-ci.yml +++ b/Release.gitlab-ci.yml @@ -52,7 +52,7 @@ unbound_release_handle_mr: - 'apk add --no-cache git jq curl' script: - | - LATEST="$(git describe --abbrev=0 --tags 2>/dev/null)" + LATEST="$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" if [[ -n "${LATEST}" && "$(cat VERSION)" == "${LATEST}" ]]; then echo "No changes worthy of a version bump" exit 0 -- 2.52.0