feat: use absolute paths by default when using working-directory option (#1231)

This commit is contained in:
Ludovic Fernandez
2025-05-04 22:03:30 +02:00
committed by GitHub
parent 9fae48acfc
commit 7774f98a88
10 changed files with 675 additions and 435 deletions

View File

@@ -54,9 +54,9 @@ jobs:
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.0
version: v2.1
```
</details>
@@ -92,9 +92,9 @@ jobs:
with:
go-version: ${{ matrix.go }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.0
version: v2.1
```
You will also likely need to add the following `.gitattributes` file to ensure that line endings for Windows builds are properly formatted:
@@ -147,11 +147,10 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.modules }}
args: --path-mode=abs
```
</details>
@@ -230,11 +229,10 @@ jobs:
with:
go-version: ${{ inputs.go-version }}
- name: golangci-lint ${{ matrix.modules }}
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: ${{ inputs.golangci-lint-version }}
working-directory: ${{ matrix.modules }}
args: --path-mode=abs
```
You will also likely need to add the following `.gitattributes` file to ensure that line endings for Windows builds are properly formatted:
@@ -247,6 +245,7 @@ You will also likely need to add the following `.gitattributes` file to ensure t
## Compatibility
* `v8.0.0` works with `golangci-lint` version >= `v2.1.0`
* `v7.0.0` supports golangci-lint v2 only.
* `v6.0.0+` removes `annotations` option, removes the default output format (`github-actions`).
* `v5.0.0+` removes `skip-pkg-cache` and `skip-build-cache` because the cache related to Go itself is already handled by `actions/setup-go`.
@@ -273,9 +272,9 @@ When `install-mode` is:
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.0
version: v2.1
# ...
```
@@ -293,7 +292,7 @@ The default value is `binary`.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
install-mode: "goinstall"
# ...
@@ -313,7 +312,7 @@ By default, it uses the `github.token` from the action.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
github-token: xxx
# ...
@@ -336,7 +335,7 @@ The JSON Schema used to validate the configuration depends on the version of gol
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
verify: false
# ...
@@ -361,7 +360,7 @@ The default value is `false`.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
only-new-issues: true
# ...
@@ -379,7 +378,7 @@ Working directory, useful for monorepos.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
working-directory: somedir
# ...
@@ -404,7 +403,7 @@ golangci-lint command line arguments.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
# In some rare cases,
# you could have to use `${{ github.workspace }}` as base directory to reference your configuration file.
@@ -432,7 +431,7 @@ The default value is `false`.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
problem-matchers: true
# ...
@@ -453,7 +452,7 @@ The default value is `false`.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
skip-cache: true
# ...
@@ -473,7 +472,7 @@ The default value is `false`.
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
skip-save-cache: true
# ...
@@ -495,7 +494,7 @@ If the number is `<= 0`, the cache will always be invalidated (Not recommended).
<summary>Example</summary>
```yml
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
cache-invalidation-interval: 15
# ...