prune: don't abort when a distro has no versioned tags
Build containers / Compute changes (push) Successful in 3s
Build containers / fedora-cosmic (rawhide) (push) Failing after 58s
Build containers / fedora-remote (44) (push) Successful in 10m43s
Build containers / fedora-cosmic (44) (push) Successful in 13m20s
Build containers / Prune old releases and tags (push) Successful in 27s

fedora-remote has no rawhide.* tags yet, so grep exited non-zero and, under
set -e/pipefail, killed prune-registry.sh before it reported anything. Tolerate
an empty match.
This commit is contained in:
2026-09-28 17:59:50 +02:00
parent 40f7aef501
commit 357bf16479
+3 -1
View File
@@ -37,8 +37,10 @@ done
declare -A keep=()
for d in "${DISTROS[@]}"; do
keep["${d}"]=1
# A distro that has no versioned tags yet is fine; don't let grep's non-zero
# exit status abort the script under set -e/pipefail.
newest="$(grep -E "^${d}\.[0-9]+\.[0-9]+$" <<< "${versions}" \
| sort -t. -k2,2n -k3,3n | tail -1)"
| sort -t. -k2,2n -k3,3n | tail -1 || true)"
[[ -n "${newest}" ]] && keep["${newest}"]=1
done