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

Octokit Response Only Returns 30 Commits #717

Closed
cmitzel-ncino opened this issue Apr 11, 2023 · 2 comments
Closed

Octokit Response Only Returns 30 Commits #717

cmitzel-ncino opened this issue Apr 11, 2023 · 2 comments

Comments

@cmitzel-ncino
Copy link
Contributor

Hey, it's me again!

The failOnErrors function works awesome - we're able to interact with the results array in another step of the job and make it so that a single passing commit will pass the linter!

However, there is one small issue. By default, Octokit only returns a single page of 30 commits, so the commit history available to the action is only up to the last 30. It's not a dealbreaker, but I doubt it's intended behavior. I attempted to add the per_page: 100, argument to the Octokit call but it broke a number of tests and I'm not sure why, so I figured I'd let you take a look.

I confirmed that is in fact only returning 30 by making a request to the github api for the PR triggering the action, and confirmed that the API (when given the param per_page=100) returned 45 commits, while the results array from the action only returned 30.

Screenshot 2023-04-11 at 4 32 09 PM

Screenshot 2023-04-11 at 4 32 42 PM

Screenshot 2023-04-11 at 4 30 56 PM

@wagoid
Copy link
Owner

wagoid commented Apr 11, 2023

Hey @cmitzel-ncino! Yeah, I was aware of that limit but didn't bother getting more to wait for people that needed it. We can definitely switch to fetch 100, I'll have a look at it when I have some time 👊

@cmitzel-ncino
Copy link
Contributor Author

No problem! I just wanted to bring it up cause I was losing my mind trying to figure out why my recent commits in my unhinged PR weren't showing up 🤣. As is it works for most repos so I totally get why it isn't a priority, I just wanted to bring it up just in case it's something you'd missed. 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants