Skip to content

Commit

Permalink
docs: improve workflow example
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed May 26, 2024
1 parent 725e015 commit 16507ab
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ The action runs [golangci-lint](https://github.com/golangci/golangci-lint) and r

## How to use

We recommend running this action in a job separate from other jobs (`go test`, etc.)
because different jobs [run in parallel](https://help.github.com/en/actions/getting-started-with-github-actions/core-concepts-for-github-actions#job).

Add `.github/workflows/golangci-lint.yml` with the following contents:

<details>
<summary>Simple Example</summary>

```yaml
name: golangci-lint
on:
Expand All @@ -46,18 +52,17 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58
```

We recommend running this action in a job separate from other jobs (`go test`, etc.)
because different jobs [run in parallel](https://help.github.com/en/actions/getting-started-with-github-actions/core-concepts-for-github-actions#job).
</details>

<details>
<summary>Multiple OS Support</summary>
<summary>Multiple OS Example</summary>

If you need to run linters for specific operating systems, you will need to use the action `>=v2`.

Expand Down

0 comments on commit 16507ab

Please sign in to comment.