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