From b859d478ec00e29a5a38e0f778c40d73b88cf1d4 Mon Sep 17 00:00:00 2001 From: Ed Savage Date: Thu, 13 Aug 2026 15:03:49 +1200 Subject: [PATCH] [ML] Fix auto-approve version-bump workflow for current gh CLI gh api rejects combining --paginate --slurp with --jq, which made the Auto-approve version bump step fail on recent patch bumps. Count approvals per page and sum instead. Co-authored-by: Cursor --- .github/workflows/auto-approve-version-bump.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto-approve-version-bump.yml b/.github/workflows/auto-approve-version-bump.yml index 997ee6496..c2cd8b617 100644 --- a/.github/workflows/auto-approve-version-bump.yml +++ b/.github/workflows/auto-approve-version-bump.yml @@ -50,11 +50,12 @@ jobs: exit 0 fi # Reopened PRs re-trigger this workflow; don't stack duplicate reviews. - # The reviews endpoint is paginated (30/page), so --paginate --slurp - # gathers every page into one array (of pages) before counting - a - # single count across all reviews rather than one per page. - approved=$(gh api --paginate --slurp "repos/$REPO/pulls/$PR/reviews" \ - --jq '[.[][] | select(.user.login == "github-actions[bot]" and .state == "APPROVED")] | length') + # The reviews endpoint is paginated (30/page). Current gh rejects + # combining --paginate --slurp with --jq, so count approvals per page + # and sum (awk). That matches the GHA ubuntu-latest gh CLI. + approved=$(gh api --paginate "repos/$REPO/pulls/$PR/reviews" \ + --jq '[.[] | select(.user.login == "github-actions[bot]" and .state == "APPROVED")] | length' \ + | awk '{s+=$1} END {print s+0}') if [ "$approved" -gt 0 ]; then echo "PR #$PR already approved by github-actions[bot]; nothing to do." exit 0