Skip to content

Latest commit

 

History

History
48 lines (42 loc) · 1.54 KB

README.md

File metadata and controls

48 lines (42 loc) · 1.54 KB

golangci-lint-runner

An runner for golangci-lint with an default (overrideable) config in an CI environment. (for github)

Features

  • Comment, Approve or Reject Pull Requests
  • Custom or multiple .golangci.yml files.
  • Use as an github app with hooks, standalone (triggered by CI or manually) or .github actions

Github Actions Setup

Create a workflow file (e.g. .github/workflows/golangci-lint-runner.yml):

name: golangci-lint-runner
on: pull_request
jobs:
  golangci-lint-runner:
    runs-on: ubuntu-latest
    steps:
      - name: linter
        uses: "docker://talononedevs/golangci-lint-runner:latest"
        with:
          entrypoint: /bin/golangci-lint-runner
          args: standalone
        env:
          APPROVE: false
          REQUEST_CHANGES: false
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
          NO_ISSUES_TEXT: "No issues found"
          NO_CHANGES_TEXT: "No issues found"

Github App Setup

  1. Create an Github App
  2. Deploy golangci-lint-runner as app somewhere
  3. set Homepage and Webhook url to your deployment
  4. create a private key and pass it into golangci-lint-runner
  5. create a webhook secret and pass it into golangci-lint-runner
  6. Subscribe to events: Pull request
  7. Permissions to set:
Contents: Read-Only
Pull-Request: Read & write
Metadata: Read-Only

Note: The code quality is not the best, this was done in a short period of time There is a lot to improve e.g. tests...