fix: prevent grep pipefail from killing tarball release uploads (#2786)

The old-asset cleanup pipeline `gh release view | grep | while` fails
when grep finds no matches (exit 1) and pipefail is set. This kills
the entire step before gh release upload runs.

Fix: wrap grep in `{ grep ... || true; }` so no-match is not fatal.

This caused all arm64 builds and some x86_64 builds to fail nightly.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ahmed Abushagur 2026-03-18 23:51:09 -07:00 committed by GitHub
parent 2825884fee
commit 5a23982513
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,8 +163,9 @@ jobs:
# Delete stale asset for this arch if present (from a previous build today)
gh release delete-asset "${TAG}" "${TARBALL}" --yes 2>/dev/null || true
# Also clean up any older-dated tarball for this arch
# grep returns exit 1 when no matches — pipe through cat to avoid pipefail killing the step
gh release view "${TAG}" --json assets --jq ".assets[].name" 2>/dev/null \
| grep "spawn-agent-${AGENT_NAME}-${ARCH}-" \
| { grep "spawn-agent-${AGENT_NAME}-${ARCH}-" || true; } \
| while IFS= read -r old; do
gh release delete-asset "${TAG}" "${old}" --yes 2>/dev/null || true
done