Skip to content

[ML] Fix auto-approve version-bump workflow for current gh CLI - #3153

Open
edsavage wants to merge 1 commit into
elastic:mainfrom
edsavage:fix/auto-approve-version-bump-gh-slurp
Open

[ML] Fix auto-approve version-bump workflow for current gh CLI#3153
edsavage wants to merge 1 commit into
elastic:mainfrom
edsavage:fix/auto-approve-version-bump-gh-slurp

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

Summary

  • The Auto-approve version-bump workflow failed on recent patch bumps (#3146 / #3147 / #3148) because gh api --paginate --slurp … --jq … is rejected by current gh (the --slurp option is not supported with --jq or --template).
  • Count github-actions approvals per page with --paginate --jq and sum with awk instead.
  • Needs backport to release branches that run pull_request_target for bump PRs (8.19, 9.4, 9.5).

Test plan

  • Locally: old gh api --paginate --slurp … --jq … still fails as on CI
  • Locally: fixed command returns 0 for #3148 and 1 for #3150 (bot-approved backport)
  • YAML still parses
  • Next automated patch bump auto-approves without a human review

Made with Cursor

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 <cursoragent@cursor.com>
@edsavage edsavage added :ml >build auto-backport Automatically merge backport PRs when CI passes v8.19.21 v9.4.6 v9.5.2 v9.6.0 labels Aug 13, 2026
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the auto-approval workflow for automated version-bump PRs by updating the gh api pagination logic to be compatible with the current GitHub CLI behavior on ubuntu-latest.

Changes:

  • Replace the unsupported gh api --paginate --slurp ... --jq ... usage with per-page counting via --paginate --jq.
  • Sum per-page approval counts with awk to preserve the original “count across all pages” behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically merge backport PRs when CI passes >build :ml v8.19.21 v9.4.6 v9.5.2 v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants