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

Error: options working-directory and only-new-issues aren't compatible #150

Closed
bojan-embroker opened this issue Jan 22, 2021 · 4 comments · Fixed by #795
Closed

Error: options working-directory and only-new-issues aren't compatible #150

bojan-embroker opened this issue Jan 22, 2021 · 4 comments · Fixed by #795
Labels
enhancement New feature or request

Comments

@bojan-embroker
Copy link

Hi,

I tried setting both working-directory and only-new-issues but got: Error: options working-directory and only-new-issues aren't compatible

I am working on a monorepo and would like to be able to get only new issues from the linter. How hard would be to allow it?

@thebeline
Copy link
Contributor

I am not familiar with the workings of a "monorepo" (I am new to golang), but as I understand it:

golangci-lint will (should?) only report issues in the changes included in the reference patch, which should only be changes actively made. This also impacts how it makes it's annotations internally.

If you want to exclude changes that may be in other directories, please have a look at the golangci-lint Configuration Options.

@warber
Copy link

warber commented Apr 11, 2021

Hi, I am also using this action in the context of a mono repo. I've created one job for each project and set the working-directory field accordingly:

name: golangci-lint
on: [pull_request]
jobs:
  golangci-first-project:
    name: lint/first-project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: v1.29
          working-directory: first-project
  golangci-second-project:
    name: lint/second-project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: v1.29
          working-directory: second-project

The PullRequest contains only changed files of first-project but the linter is also checking and reporting findings in second-project
Do I need to configure the action differently?

@HarryMichal
Copy link

Hi! Our project has its source code in a subdirectory. Thus we need to set the working-directory option which leads to this error.

@CfirTsabari
Copy link
Contributor

I have created a PR that should address this issue #795

@ldez ldez closed this as completed in #795 Aug 14, 2023
@ldez ldez added the enhancement New feature or request label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants