ci: drop pagination and head pipe in asset URL lookup

Addresses review feedback: `gh api | head -n1` can fail under bash
pipefail because head closes the pipe early and SIGPIPEs gh api. The
tag_name + asset-name filter already returns a single URL, so drop
--paginate and the head pipe.
This commit is contained in:
Josh Lambert
2026-04-18 10:55:45 -04:00
parent b3ce557f21
commit a1321bf54f
+4 -3
View File
@@ -92,9 +92,10 @@ jobs:
# releases too (browser /releases/download/... URLs 404 on drafts).
# The installer passes Accept: application/octet-stream + bearer
# auth, which is what the API asset endpoint expects.
URL=$(gh api --paginate "repos/${{ github.repository }}/releases" \
--jq ".[] | select(.tag_name == \"v${VERSION}\") | .assets[] | select(.name == \"kilo-linux-x64.tar.gz\") | .url" \
| head -n1)
# The tag_name filter yields at most one release and one asset,
# so --jq returns a single URL without needing head/pipefail games.
URL=$(gh api "repos/${{ github.repository }}/releases" \
--jq ".[] | select(.tag_name == \"v${VERSION}\") | .assets[] | select(.name == \"kilo-linux-x64.tar.gz\") | .url")
if [[ -z "$URL" ]]; then
echo "::error::asset kilo-linux-x64.tar.gz not found for v${VERSION}"
exit 1