fix: codeberg_api_all propagates API errors instead of silently returning []
Remove || break from the codeberg_api call in the pagination loop. With set -euo pipefail in all callers, a failed fetch now exits the function non-zero — matching the original curl -sf behaviour where a network or auth error aborted the script rather than returning empty results and risking a duplicate review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9fa4846581
commit
d5b3f9e6e5
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ codeberg_api_all() {
|
||||||
esac
|
esac
|
||||||
page=1
|
page=1
|
||||||
while true; do
|
while true; do
|
||||||
page_items=$(codeberg_api GET "${path_prefix}${sep}limit=50&page=${page}") || break
|
page_items=$(codeberg_api GET "${path_prefix}${sep}limit=50&page=${page}")
|
||||||
count=$(printf '%s' "$page_items" | jq 'length')
|
count=$(printf '%s' "$page_items" | jq 'length')
|
||||||
[ "$count" -eq 0 ] && break
|
[ "$count" -eq 0 ] && break
|
||||||
all_items=$(printf '%s\n%s' "$all_items" "$page_items" | jq -s 'add')
|
all_items=$(printf '%s\n%s' "$all_items" "$page_items" | jq -s 'add')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue