Skip to content

Commit 3061011

Browse files
committed
chore(gh): update golangci-lint workflow
- Updates the GitHub Action for `golangci-lint`. - Pin GitHub Actions to release commit SHA. Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
1 parent 29c3d0a commit 3061011

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.github/workflows/golangci-lint.yml

+24-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
name: golangci-lint
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'README.md'
7+
push:
8+
paths-ignore:
9+
- 'README.md'
10+
11+
permissions:
12+
contents: read
413

514
jobs:
6-
golangci:
7-
name: lint
15+
build:
16+
name: Build
817
runs-on: ubuntu-latest
18+
timeout-minutes: 5
919
steps:
10-
- uses: actions/setup-go@v5
20+
- name: Checkout
21+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
22+
- name: Setup Go
23+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
1124
with:
12-
go-version: 1.19
13-
- uses: actions/checkout@v4
14-
- name: golangci-lint
15-
uses: golangci/golangci-lint-action@v6
25+
go-version-file: 'go.mod'
26+
cache: true
27+
- run: go mod download
28+
- run: go build -v .
29+
- name: Run Linters
30+
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
1631
with:
17-
version: v1.48.0
18-
args: --issues-exit-code=1
19-
only-new-issues: true
20-
skip-cache: true
32+
version: latest

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ linters:
77
enable:
88
- asciicheck
99
- bodyclose
10+
- copyloopvar
1011
- depguard
1112
- dogsled
1213
- dupl
1314
- errcheck
14-
- exportloopref
1515
- funlen
1616
- goconst
1717
- gocognit

0 commit comments

Comments
 (0)