|
| 1 | +name: golangci-lint |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + # Optional: allow read access to pull request. Use with `only-new-issues` option. |
| 11 | + # pull-requests: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + golangci: |
| 15 | + name: lint |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v3 |
| 19 | + - uses: actions/setup-go@v4 |
| 20 | + with: |
| 21 | + go-version: '1.20' |
| 22 | + cache: false |
| 23 | + - name: golangci-lint |
| 24 | + uses: golangci/golangci-lint-action@v3 |
| 25 | + with: |
| 26 | + # Require: The version of golangci-lint to use. |
| 27 | + # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. |
| 28 | + # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. |
| 29 | + version: v1.54 |
| 30 | + |
| 31 | + # Optional: working directory, useful for monorepos |
| 32 | + # working-directory: somedir |
| 33 | + |
| 34 | + # Optional: golangci-lint command line arguments. |
| 35 | + # |
| 36 | + # Note: By default, the `.golangci.yml` file should be at the root of the repository. |
| 37 | + # The location of the configuration file can be changed by using `--config=` |
| 38 | + # args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 |
| 39 | + |
| 40 | + # Optional: show only new issues if it's a pull request. The default value is `false`. |
| 41 | + # only-new-issues: true |
| 42 | + |
| 43 | + # Optional: if set to true, then all caching functionality will be completely disabled, |
| 44 | + # takes precedence over all other caching options. |
| 45 | + # skip-cache: true |
| 46 | + |
| 47 | + # Optional: if set to true, then the action won't cache or restore ~/go/pkg. |
| 48 | + # skip-pkg-cache: true |
| 49 | + |
| 50 | + # Optional: if set to true, then the action won't cache or restore ~/.cache/go-build. |
| 51 | + # skip-build-cache: true |
| 52 | + |
| 53 | + # Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'. |
| 54 | + # install-mode: "goinstall"ses: golangci/golangci-lint-action@v3.7.0 |
0 commit comments