action-ktlint
action-ktlint copied to clipboard
Ktlint job fails on PRs with > 300 files.
About 2 months ago we updated to use ktlint version 1.1.1 Since last 2 weeks we've had a few cases with PRs having >300 files. action-ktlint fails on these PRs with the following error excerpt.
2024-04-11T13:09:41.4432546Z ktlint version: 1.1.1
2024-04-11T13:13:25.4815816Z reviewdog: post failed for ktlint: fail to parse diff: GET https://api.github.com/repos/Org/my-repo/pulls/123: 406 Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API or locally cloning the repository instead. [{Resource:PullRequest Field:diff Code:too_large Message:}]
Not sure if this is failing now due to v1.1.1 or some new Github API changes.
Related: https://github.com/reviewdog/reviewdog/issues/1696
Seems like this is fixed with https://github.com/reviewdog/reviewdog/pull/1714
I'll try to upgrade to https://github.com/reviewdog/reviewdog/releases/tag/v0.17.4
@rohan-sca @sergiomr88 please let me know if you still face this issue.
Thanks @ghaiszaher we'll keep an eye out.
Based on this comment https://github.com/reviewdog/reviewdog/issues/1696#issuecomment-2077370044, it looks like the current solution is to pass the argument reporter: github-pr-review
.
Example:
- name: ktlint
uses: ScaCap/action-ktlint@master
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
Do please keep an eye on updates from reviewDog though, currently we're forced to use reporter: github-pr-review
which can lead to it spamming PR comments for the ktlint checks.
currently we're forced to use
reporter: github-pr-review
which can lead to it spamming PR comments for the ktlint checks.
@rohan-sca this can be removed now, latest reviewdog version provides a fix also for github-pr-check
reporters (which is the default value)