Skip to content

Commit 9b63474

Browse files
authored
Merge pull request #4 from useblacksmith/patch-v8
*: mint v8
2 parents 42de90f + fbcdd0d commit 9b63474

File tree

12 files changed

+1369
-634
lines changed

12 files changed

+1369
-634
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
version:
5555
- ""
5656
- "latest"
57-
- "v2.0"
58-
- "v2.0.0"
57+
- "v2.1"
58+
- "v2.1.0"
5959
runs-on: ${{ matrix.os }}
6060
permissions:
6161
contents: read
@@ -83,8 +83,8 @@ jobs:
8383
version:
8484
- ""
8585
- "latest"
86-
- "v2.0.0"
87-
- "1f032fbc4b117e4247b19ff606cc847ab5383bc9"
86+
- "v2.1.0"
87+
- "f6c2e6c999dfae444d1fe7f1b0d49becdae44547"
8888
runs-on: ${{ matrix.os }}
8989
permissions:
9090
contents: read

README.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and r
1212

1313
## Supporting Us
1414

15-
<!-- [![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci) -->
15+
[![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci)
1616
[![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint)
1717
[![Linter Authors](https://img.shields.io/badge/Linter_Authors-Donate-blue?style=for-the-badge)](https://golangci-lint.run/product/thanks/)
1818

1919
`golangci-lint` is a free and open-source project built by volunteers.
2020

21-
If you value it, consider supporting us, we appreciate it! :heart:
21+
If you value it, consider supporting us; we appreciate it! :heart:
2222

2323
## How to use
2424

@@ -54,9 +54,9 @@ jobs:
5454
with:
5555
go-version: stable
5656
- name: golangci-lint
57-
uses: golangci/golangci-lint-action@v7
57+
uses: golangci/golangci-lint-action@v8
5858
with:
59-
version: v2.0
59+
version: v2.1
6060
```
6161
6262
</details>
@@ -92,9 +92,9 @@ jobs:
9292
with:
9393
go-version: ${{ matrix.go }}
9494
- name: golangci-lint
95-
uses: golangci/golangci-lint-action@v7
95+
uses: golangci/golangci-lint-action@v8
9696
with:
97-
version: v2.0
97+
version: v2.1
9898
```
9999
100100
You will also likely need to add the following `.gitattributes` file to ensure that line endings for Windows builds are properly formatted:
@@ -120,7 +120,7 @@ on:
120120
121121
env:
122122
GO_VERSION: stable
123-
GOLANGCI_LINT_VERSION: v2.0
123+
GOLANGCI_LINT_VERSION: v2.1
124124
125125
jobs:
126126
detect-modules:
@@ -147,7 +147,7 @@ jobs:
147147
with:
148148
go-version: ${{ env.GO_VERSION }}
149149
- name: golangci-lint ${{ matrix.modules }}
150-
uses: golangci/golangci-lint-action@v7
150+
uses: golangci/golangci-lint-action@v8
151151
with:
152152
version: ${{ env.GOLANGCI_LINT_VERSION }}
153153
working-directory: ${{ matrix.modules }}
@@ -179,7 +179,7 @@ jobs:
179179
with:
180180
os: ${{ matrix.os }}
181181
go-version: ${{ matrix.go-version }}
182-
golangci-lint-version: v2.0
182+
golangci-lint-version: v2.1
183183
```
184184

185185
```yaml
@@ -201,7 +201,7 @@ on:
201201
golangci-lint-version:
202202
description: 'Golangci-lint version'
203203
type: string
204-
default: 'v2.0'
204+
default: 'v2.1'
205205
206206
jobs:
207207
detect-modules:
@@ -229,7 +229,7 @@ jobs:
229229
with:
230230
go-version: ${{ inputs.go-version }}
231231
- name: golangci-lint ${{ matrix.modules }}
232-
uses: golangci/golangci-lint-action@v7
232+
uses: golangci/golangci-lint-action@v8
233233
with:
234234
version: ${{ inputs.golangci-lint-version }}
235235
working-directory: ${{ matrix.modules }}
@@ -245,13 +245,14 @@ You will also likely need to add the following `.gitattributes` file to ensure t
245245

246246
## Compatibility
247247

248+
* `v8.0.0` works with `golangci-lint` version >= `v2.1.0`
248249
* `v7.0.0` supports golangci-lint v2 only.
249250
* `v6.0.0+` removes `annotations` option, removes the default output format (`github-actions`).
250251
* `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`.
251252
* `v4.0.0+` requires an explicit `actions/setup-go` installation step before using this action: `uses: actions/setup-go@v5`.
252253
The `skip-go-installation` option has been removed.
253254
* `v2.0.0+` works with `golangci-lint` version >= `v1.28.3`
254-
* `v1.2.2` is deprecated due to we forgot to change the minimum version of `golangci-lint` to `v1.28.3` ([issue](https://github.com/golangci/golangci-lint-action/issues/39))
255+
* `v1.2.2` is deprecated because we forgot to change the minimum version of `golangci-lint` to `v1.28.3` ([issue](https://github.com/golangci/golangci-lint-action/issues/39))
255256
* `v1.2.1` works with `golangci-lint` version >= `v1.14.0` ([issue](https://github.com/golangci/golangci-lint-action/issues/39))
256257

257258
## Options
@@ -271,9 +272,9 @@ When `install-mode` is:
271272
<summary>Example</summary>
272273

273274
```yml
274-
uses: golangci/golangci-lint-action@v7
275+
uses: golangci/golangci-lint-action@v8
275276
with:
276-
version: v2.0
277+
version: v2.1
277278
# ...
278279
```
279280

@@ -291,7 +292,7 @@ The default value is `binary`.
291292
<summary>Example</summary>
292293

293294
```yml
294-
uses: golangci/golangci-lint-action@v7
295+
uses: golangci/golangci-lint-action@v8
295296
with:
296297
install-mode: "goinstall"
297298
# ...
@@ -311,7 +312,7 @@ By default, it uses the `github.token` from the action.
311312
<summary>Example</summary>
312313

313314
```yml
314-
uses: golangci/golangci-lint-action@v7
315+
uses: golangci/golangci-lint-action@v8
315316
with:
316317
github-token: xxx
317318
# ...
@@ -325,16 +326,16 @@ with:
325326

326327
This option is `true` by default.
327328

328-
If the GitHub Action detects configuration file the validation will be performed unless this option is set to `false`.
329+
If the GitHub Action detects a configuration file, the validation will be performed unless this option is set to `false`.
329330
If there is no configuration file, the validation is skipped.
330331

331-
The JSONSchema used to validate the configuration depends on the version of golangci-lint you are using.
332+
The JSON Schema used to validate the configuration depends on the version of golangci-lint you are using.
332333

333334
<details>
334335
<summary>Example</summary>
335336

336337
```yml
337-
uses: golangci/golangci-lint-action@v7
338+
uses: golangci/golangci-lint-action@v8
338339
with:
339340
verify: false
340341
# ...
@@ -350,16 +351,16 @@ Show only new issues.
350351

351352
The default value is `false`.
352353

353-
* `pull_request` and `pull_request_target`: the action gets the diff of the PR content from the [GitHub API](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) and use it with `--new-from-patch`.
354-
* `push`: the action gets the diff of the push content (difference between commits before and after the push) from the [GitHub API](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits) and use it with `--new-from-patch`.
354+
* `pull_request` and `pull_request_target`: the action gets the diff of the PR content from the [GitHub API](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request) and uses it with `--new-from-patch`.
355+
* `push`: the action gets the diff of the push content (difference between commits before and after the push) from the [GitHub API](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits) and uses it with `--new-from-patch`.
355356
* `merge_group`: the action gets the diff by using `--new-from-rev` option (relies on git).
356357
You should add the option `fetch-depth: 0` to `actions/checkout` step.
357358

358359
<details>
359360
<summary>Example</summary>
360361

361362
```yml
362-
uses: golangci/golangci-lint-action@v7
363+
uses: golangci/golangci-lint-action@v8
363364
with:
364365
only-new-issues: true
365366
# ...
@@ -377,7 +378,7 @@ Working directory, useful for monorepos.
377378
<summary>Example</summary>
378379

379380
```yml
380-
uses: golangci/golangci-lint-action@v7
381+
uses: golangci/golangci-lint-action@v8
381382
with:
382383
working-directory: somedir
383384
# ...
@@ -391,15 +392,21 @@ with:
391392

392393
golangci-lint command line arguments.
393394

394-
Note: By default, the `.golangci.yml` file should be at the root of the repository.
395-
The location of the configuration file can be changed by using `--config=`
395+
> [!NOTE]
396+
> By default, the `.golangci.yml` file should be at the root of the repository.
397+
> The location of the configuration file can be changed by using `--config=`.
398+
399+
> [!IMPORTANT]
400+
> Adding a `=` between the flag name and its value is important because the action parses the arguments on spaces.
396401

397402
<details>
398403
<summary>Example</summary>
399404

400405
```yml
401-
uses: golangci/golangci-lint-action@v7
406+
uses: golangci/golangci-lint-action@v8
402407
with:
408+
# In some rare cases,
409+
# you could have to use `${{ github.workspace }}` as base directory to reference your configuration file.
403410
args: --config=/my/path/.golangci.yml --issues-exit-code=0
404411
# ...
405412
```
@@ -414,7 +421,7 @@ Force the usage of the embedded problem matchers.
414421

415422
By default, the [problem matcher of Go (`actions/setup-go`)](https://github.com/actions/setup-go/blob/main/matchers.json) already handles the default golangci-lint output (`text`).
416423

417-
Works only with `colored-line-number` (the golangci-lint default).
424+
Works only with `text` format (the golangci-lint default).
418425

419426
https://golangci-lint.run/usage/configuration/#output-configuration
420427

@@ -424,7 +431,7 @@ The default value is `false`.
424431
<summary>Example</summary>
425432

426433
```yml
427-
uses: golangci/golangci-lint-action@v7
434+
uses: golangci/golangci-lint-action@v8
428435
with:
429436
problem-matchers: true
430437
# ...
@@ -445,7 +452,7 @@ The default value is `false`.
445452
<summary>Example</summary>
446453

447454
```yml
448-
uses: golangci/golangci-lint-action@v7
455+
uses: golangci/golangci-lint-action@v8
449456
with:
450457
skip-cache: true
451458
# ...
@@ -457,15 +464,15 @@ with:
457464

458465
(optional)
459466

460-
If set to `true`, caches will not be saved, but they may still be restored, required `skip-cache: false`.
467+
If set to `true`, caches will not be saved, but they may still be restored, requiring `skip-cache: false`.
461468

462469
The default value is `false`.
463470

464471
<details>
465472
<summary>Example</summary>
466473

467474
```yml
468-
uses: golangci/golangci-lint-action@v7
475+
uses: golangci/golangci-lint-action@v8
469476
with:
470477
skip-save-cache: true
471478
# ...
@@ -481,13 +488,13 @@ Periodically invalidate the cache every `cache-invalidation-interval` days to en
481488

482489
The default value is `7`.
483490

484-
If set the number is `<= 0`, the cache will be always invalidate (Not recommended).
491+
If the number is `<= 0`, the cache will always be invalidated (Not recommended).
485492

486493
<details>
487494
<summary>Example</summary>
488495

489496
```yml
490-
uses: golangci/golangci-lint-action@v7
497+
uses: golangci/golangci-lint-action@v8
491498
with:
492499
cache-invalidation-interval: 15
493500
# ...
@@ -516,7 +523,7 @@ permissions:
516523
pull-requests: read
517524
```
518525
519-
For annotations to work use the default format output (`text`) and either use `actions/setup-go` in the job or enable the internal [problem matchers](#problem-matchers).
526+
For annotations to work, use the default format output (`text`) and either use `actions/setup-go` in the job or enable the internal [problem matchers](#problem-matchers).
520527

521528
## Performance
522529

0 commit comments

Comments
 (0)