-
-
Notifications
You must be signed in to change notification settings - Fork 164
Annotations fail for mono-repo if not using 'args: --path-prefix=' (but this makes CI very slow) #1228
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
Comments
hello, I recommend using golangci-lint v2.1 and the cli flag |
@ldez Thanks a lot! 🙌 Should this be the default behavior when running with 'working-directory'? Or should we add it to the example code for workspaces? Seems like other people would have the same issue. Either way I can take a stab at it if you agree. |
As a first non-breaking step, I would prefer an update of the documentation. The update of the action requires more changes than just adding the arg, I would like to handle this part by myself if possible for you. (FYI, I'm already working on that, but you opened a PR before I finished my work) |
Sounds good! Thanks for a great GitHub action by the way! ❤️ |
Welcome
Description of the problem
I'm setting up golangci-lint GH action and it works almost. I follow the "Go Workspace Example" from https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#how-to-use (but for me each lint job runs as as step in my regular build job, I have 50+ services/jobs already, so it seemed easiest to do it that way.)
By running my job with debug logging turned on I see that file is dropped:
Notice that the path has a weird structure, it contains the working directory twice:
/home/runner/work/hive/hive/hava-pkg/hava-pkg/docker_helpers/directus.go
. Here 'hive' is my repo and 'hava-pkg' my working directory.Issues are successfully reported as issues on the jobs themselves itself, see image below:
But annotations fail to be shown in the "Files changed" tab on the pull request, see image below, where no annotation shows up:
Root cause could be that the
working-directory
thoughpath-prefix
(https://github.com/golangci/golangci-lint-action/blob/main/src/run.ts#L127) gets added twice to the path that attempts to be sent to GitHub annotations and it rejects it.One (bad) workaround is to run my job step like this:
However, this has balloons the time by 10x, presumably each CI job runs the linting for all the other services as well?
Version of golangci-lint
v2.0.2
Version of the GitHub Action
v7
Workflow file
Golangci-lint configuration
Go version
go1.24.2
Code example or link to a public repository
// add your code here
The text was updated successfully, but these errors were encountered: