Skip to content

golangci/golangci-lint-action-plugin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.