Skip to content

Commit 1be85c8

Browse files
committed
fix: add pr pagination
1 parent 562a0b3 commit 1be85c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gh-cli/merge-pull-requests-by-title.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ while IFS= read -r repo_url || [ -n "$repo_url" ]; do
135135
jq_pattern="$pr_title_pattern"
136136
fi
137137

138-
# Get open PRs and filter by title
139-
matching_prs=$(gh pr list --repo "$repo" --state open --json number,title,author --limit 100 2>/dev/null | \
140-
jq -r --arg pattern "$jq_pattern" ".[] | $jq_filter | \"\(.number)|\(.title)|\(.author.login)\"")
138+
# Get open PRs and filter by title (paginate to get all PRs)
139+
matching_prs=$(gh api --paginate "/repos/$repo/pulls?state=open" 2>/dev/null | \
140+
jq -r --arg pattern "$jq_pattern" ".[] | $jq_filter | \"\(.number)|\(.title)|\(.user.login)\"")
141141

142142
if [ -z "$matching_prs" ]; then
143143
echo " 📭 No matching PRs found"

0 commit comments

Comments
 (0)