Skip to content

Commit f783b4e

Browse files
committed
chore(ci): build golangci-lint from go.sum to align with project version
Replace the golangci-lint-action (which downloads the latest release) with a go build from the version pinned in go.sum. This ensures the CI linter matches what developers run locally via `make lint`. Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
1 parent 732952a commit f783b4e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/golangci-lint.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ jobs:
3434
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
3535
with:
3636
go-version-file: go.mod
37-
- name: golangci-lint
38-
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
37+
- name: Cache golangci-lint binary
38+
id: lint-cache
39+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3940
with:
40-
version: latest
41-
args: --concurrency 4 --verbose --config=.golangci.yaml --timeout=25m
42-
only-new-issues: true
43-
skip-cache: true
41+
path: /tmp/golangci-lint
42+
key: golangci-lint-${{ hashFiles('go.sum') }}
43+
- name: Build golangci-lint
44+
if: steps.lint-cache.outputs.cache-hit != 'true'
45+
run: GOOS=linux GOARCH=amd64 go build -o /tmp/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
46+
- name: golangci-lint
47+
run: /tmp/golangci-lint run --new-from-rev=${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before || 'HEAD~1' }} --concurrency 4 --verbose --config=.golangci.yaml --timeout=25m

0 commit comments

Comments
 (0)