-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Setting workdir breaks GitHub action annotations #31
Comments
@nkansal96 It seems like a bug to me. working-dir is passed as shell cwd while running golangci-lint. We can try to somehow append it into golangci-lint output. Another alternative option is to support path to config file (--config like golangci-lint) and always run scanning from root directory. Need your input on second option as well, is there any reason/issue if you try to run from root directory ? or you just want to keep .golangci.yaml inside gocode directory ? |
Thanks for the quick response @sayboras The I also tried running One option here is to add a flag to |
@nkansal96 you should find my above PR helpful (I know I do) |
@jwilner Awesome! Thank you for making the contribution :) |
It would be great it the action will automatically set |
@SVilgelm that would make sense to me if we can be sure that there are no existing usages of |
Fixed in #34 |
I have a project that supports multiple languages, and all of the go code is in a well-behaved subdirectory:
I configured the
golangci-lint-action
as such:I am using the default
.golangci.yml
configuration file. I tested a change that should fail the linter and I get the error correctly in the GitHub actions format:However, the error doesn't show up as an annotation on the pull request. Upon further investigation, it seems like the real out (from running locally) is this:
The problem appears to be that the file is outputted relative to the working directory and not the root of the GitHub repository (i.e. the path should be
gocode/cmd/server/main.go
) which seems to be preventing GitHub from correctly handling this.This appear to be a bug. Can this be fixed with an option of some kind? Or is there an existing option that handles this case?
The text was updated successfully, but these errors were encountered: