From 7110f2e6975b769ec9b4dbceaa63dc4a75f25501 Mon Sep 17 00:00:00 2001 From: Julian Goldstein Date: Fri, 19 Jun 2026 14:40:41 -0500 Subject: [PATCH] ci: don't fail version compute on an empty tag set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With set -o pipefail, grep exits 1 when no tags match, which failed the whole 'latest=...' pipeline — exactly the fresh-start case (no tags) that should yield v0.1.0. Wrap the grep in { grep ... || true; } so an empty match is benign. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 027508f..3823764 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,7 +58,9 @@ jobs: *) default_lvl=2 # mainline: unmarked -> minor tagpat='^v[0-9]+\.[0-9]+(\.[0-9]+)?$' ;; esac - latest="$(git tag -l 'v[0-9]*' | grep -E "$tagpat" | sed 's/^v//' | sort -V | tail -1)" + # `|| true` so an empty tag set (no match) doesn't fail the pipeline + # under pipefail — that's the fresh-start case, which yields v0.1.0. + latest="$(git tag -l 'v[0-9]*' | { grep -E "$tagpat" || true; } | sed 's/^v//' | sort -V | tail -1)" if [ -z "$latest" ]; then next="0.1.0" else