This repository is an example to explain how to use custom linters (plugins) with the GitHub Action of golangci-lint.
- name: Build and install plugins
run: |
git clone https://github.com/golangci/example-plugin-linter.git
cd example-plugin-linter
go build -o '${{ github.workspace }}/.plugins/example.so' -buildmode=plugin plugin/example.go
working-directory: ${{ runner.temp }}
env:
CGO_ENABLED: 1
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.2
# The installation mode `goinstall` always uses `CGO_ENABLED=1`.
install-mode: goinstall
args: --timeout=5m
The Workflow.