-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
When a patch cannot be downloaded and only-new-issues
is set, error instead of running
#996
Comments
Same issue; Go 1.21, golangci-lint 1.55.1, Github action v4. Was this introduced by V4? At the moment this will happen for any PR with |
I just hit this even more explicitly: I'm not sure what I'd want in this case. Failing would be bad, because then there'd be no way around it -- but I also don't want to run my linter on all code, because we have existing lints in our codebase that we haven't fixed yet (so it fails anyway). |
Hello, I'm not sure how to fix that 🤔 Solutions:
Solution 1 is a problem because you will have an error but you will never be able to "fix" this error, so your PR will be blocked forever. Solution 2 is very complex: manually creating a diff is not trivial and it's brittle. Solution 3 can work, but by default the action For now, I see no other solutions inside the |
Welcome
Description of the problem
I recently had a run of golangci-lint where the GitHub API responded with 422 downloading the patch for the PR. The PR was very small (6 lines, 1 file changed), but the API responded with the following:
failed to fetch pull request patch: RequestError [HttpError]: The diff could not be processed because too many files changed
This lint run has
only-new-issues
set, but without the patch it flagged a large number of issues in the entire repo because it ran without the patch.It would be nice to have an option to error sooner and more obviously if the patch couldn't be downloaded instead of running the linter on the whole codebase. I understand that it may not be desirable for all use cases, so I propose making this a configuration option.
Version of golangci-lint
1.56.2
Version of the GitHub Action
4.0.0
Workflow file
Go version
1.22.0
Code example or link to a public repository
N/A
The text was updated successfully, but these errors were encountered: