Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,30 @@ jobs:
version: ${{ matrix.version }}
working-directory: sample-plugins
args: --timeout=5m --issues-exit-code=0 ./...

test-monorepo:
needs: [ build ]
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04-arm
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24.x
- uses: actions/setup-go@v6
with:
go-version: oldstable
- uses: ./
with:
working-directory: sample-monorepo
experimental: "automatic-module-directories"
args: --timeout=5m --issues-exit-code=0 ./...
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ You will also likely need to add the following `.gitattributes` file to ensure t
| [`skip-save-cache`](#skip-save-cache) | Don't save cache. |
| [`cache-invalidation-interval`](#cache-invalidation-interval) | Number of days before cache invalidation. |
| [`problem-matchers`](#problem-matchers) | Forces the usage of the embedded problem matchers. |
| [Experimental](#experimental) | Experimental options |

### Installation

Expand Down Expand Up @@ -552,6 +553,47 @@ with:

</details>

### Experimental

The following options are experimental: those may or may not be supported in the future, and so they will be either converted into a dedicated option or removed.

List of comma-separated options.

<details>
<summary>Example</summary>

```yaml
uses: golangci/golangci-lint-action@v9
with:
experimental: "foo,bar"
```

</details>

#### `automatic-module-directories`

(optional)

This option will run golangci-lint in each module directory, useful for monorepos.

The automatic detection of modules uses the `working-directory` as the base directory if defined, otherwise the root directory.

> [!IMPORTANT]
> - The cache key will refer to the `working-directory` (if defined) because all the golangci-lint runs must use the same cache directory/key.
> - The version detection will only work if the project has a single module.
> - If the project has multiple modules, the custom build file must be located in the repository root ( or `working-directory`).

<details>
<summary>Example</summary>

```yaml
uses: golangci/golangci-lint-action@v9
with:
experimental: "automatic-module-directories"
```

</details>

## Annotations

Currently, GitHub parses the action's output and creates [annotations](https://github.blog/2018-12-14-introducing-check-runs-and-annotations/).
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ inputs:
example: "cache,clean"
default: ""
required: false
experimental:
description: |
Experimental options for the action.
List of comma separated options.
default: ""
required: false
runs:
using: "node24"
main: "dist/run/index.js"
Expand Down
Loading
Loading