File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 - name : Run golangci-lint
2727 uses : golangci/golangci-lint-action@v7
2828 with :
29- version : v2.8.0
29+ version-file : .tool-versions
Original file line number Diff line number Diff line change 1+ golangci-lint 2.8.0
Original file line number Diff line number Diff line change @@ -17,13 +17,9 @@ test-integration: build
1717
1818mock-generate :
1919 go generate ./...
20- GOLANGCI_LINT_VERSION := 2.8.0
2120
2221lint :
23- @which golangci-lint > /dev/null || (echo " golangci-lint not found." && exit 1)
24- @INSTALLED=$$(golangci-lint version --short | sed 's/^v//' ) ; \
25- if [ " $$ INSTALLED" != " $( GOLANGCI_LINT_VERSION) " ]; then \
26- echo " golangci-lint version mismatch: installed $$ INSTALLED, expected $( GOLANGCI_LINT_VERSION) " ; \
27- exit 1; \
28- fi
22+ @EXPECTED=$$(awk '/^golangci-lint/ {print $$2}' .tool-versions ) ; \
23+ INSTALLED=$$(golangci-lint version --short 2>/dev/null | sed 's/^v//' ) ; \
24+ [ " $$ INSTALLED" = " $$ EXPECTED" ] || { echo " golangci-lint $$ EXPECTED required (found: $$ INSTALLED)" ; exit 1; }
2925 golangci-lint run
You can’t perform that action at this time.
0 commit comments