diff --git a/ci/scripts/common/bump_version.sh b/ci/scripts/common/bump_version.sh index b9bb3f5..e92261f 100755 --- a/ci/scripts/common/bump_version.sh +++ b/ci/scripts/common/bump_version.sh @@ -6,8 +6,13 @@ cd "${REPO_ROOT}" VERSION_FILE="./version" if [ ! -f "${VERSION_FILE}" ]; then - echo "[bump-version] version file not found: ${VERSION_FILE}" >&2 - exit 1 + if git cat-file -e "HEAD:version" 2>/dev/null; then + echo "[bump-version] version file missing in workspace, restoring from HEAD" >&2 + git checkout -- version + else + echo "[bump-version] version file not found: ${VERSION_FILE}" >&2 + exit 1 + fi fi CURRENT_VERSION="$(cat "${VERSION_FILE}")"