Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.12 KB

File metadata and controls

32 lines (25 loc) · 1.12 KB

Golangci-lint-action and Plugins Example

This repository is an example to explain how to use custom linters (plugins) with the GitHub Action of golangci-lint.

Build and Install Plugins

      - 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

Install and Run golangci-lint

      - 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

Full Example

The Workflow.