From bd237e52974d2f4b61d4081c3005860adf183f4e Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Thu, 11 Sep 2025 13:22:17 +0200 Subject: [PATCH] fix: update version handling in gitlab-ci configuration Check for the existence of the version file before reading it. If the file is missing, print a message and exit gracefully. This change improves the robustness of the CI pipeline by preventing errors when the version file is not present. --- Release.gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Release.gitlab-ci.yml b/Release.gitlab-ci.yml index 54e69e8..bb4d2d4 100644 --- a/Release.gitlab-ci.yml +++ b/Release.gitlab-ci.yml @@ -244,7 +244,11 @@ unbound_release_tag: - 'apk add --no-cache git jq curl' script: - | - VERSION="$(cat VERSION)" + if [ ! -r .version ]; then + echo "Version file not found" + exit 0 + fi + VERSION="$(cat .version 2>/dev/null | jq -r '.version')" LATEST="$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" if [[ -n "${LATEST}" && "${VERSION}" == "${LATEST}" ]]; then echo "Version ${VERSION} already exists"