fix: codeberg_api_all does not accept a custom token parameter (#198)

Add optional second TOKEN parameter to codeberg_api_all in lib/env.sh,
defaulting to $CODEBERG_TOKEN. Pass $REVIEW_BOT_TOKEN at the dismiss
block in review-pr.sh so reviews are fetched as the review bot account.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-19 01:25:44 +00:00
parent dfd4e00d34
commit 17907063f6
2 changed files with 3 additions and 1 deletions

View file

@ -60,8 +60,10 @@ codeberg_api() {
# Paginate a Codeberg API GET endpoint and return all items as a merged JSON array.
# Usage: codeberg_api_all /path (no existing query params)
# codeberg_api_all /path?a=b (with existing params — appends &limit=50&page=N)
# codeberg_api_all /path TOKEN (optional second arg: token; defaults to $CODEBERG_TOKEN)
codeberg_api_all() {
local path_prefix="$1"
local CODEBERG_TOKEN="${2:-${CODEBERG_TOKEN}}"
local sep page page_items count all_items="[]"
case "$path_prefix" in
*"?"*) sep="&" ;;