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

Ktlint job fails on PRs with > 300 files. #52

Open
rohan-sca opened this issue Apr 11, 2024 · 4 comments · Fixed by #53
Open

Ktlint job fails on PRs with > 300 files. #52

rohan-sca opened this issue Apr 11, 2024 · 4 comments · Fixed by #53
Assignees

Comments

@rohan-sca
Copy link

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.

@ghaiszaher
Copy link
Member

Related: reviewdog/reviewdog#1696

Seems like this is fixed with reviewdog/reviewdog#1714

I'll try to upgrade to https://github.com/reviewdog/reviewdog/releases/tag/v0.17.4

@ghaiszaher
Copy link
Member

@rohan-sca @sergiomr88 please let me know if you still face this issue.

@rohan-sca
Copy link
Author

Thanks @ghaiszaher we'll keep an eye out.

@ghaiszaher ghaiszaher self-assigned this May 3, 2024
ghaiszaher added a commit that referenced this issue May 6, 2024
@ghaiszaher
Copy link
Member

Based on this comment reviewdog/reviewdog#1696 (comment), 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

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

Successfully merging a pull request may close this issue.

2 participants