Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: increase page size of GH PR API call #13518

Merged
merged 1 commit into from
Mar 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/ci_check_no_file_changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ -z ${PR_NUMBER} ]]; then
exit 1
fi

URL="https://api.github.com/repos/${GITHUB_REPO}/pulls/${PR_NUMBER}/files"
URL="https://api.github.com/repos/${GITHUB_REPO}/pulls/${PR_NUMBER}/files?per_page=1000"
Copy link
Member

@ktmud ktmud Mar 9, 2021

Choose a reason for hiding this comment

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

Looks like I'm late to the party again. The maximum per_page size is 100 according to the document, although I'd assume we won't regularly exceed that limit anyway.

To obtain more than 100 items, there is a convenient pagination helper in GitHub script.
This PR has an example.

For convenience and future extensibility, we might want to convert this file to GitHub script the next time we touch it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was actually intending to make a cleaner solution, this is to unblock immediate PRs suffering from this. I'll fix this properly this week.

FILES=$(curl -s -X GET -G "${URL}" | jq -r '.[] | .filename')

REGEXES=()
Expand Down