An runner for golangci-lint with an default (overrideable) config in an CI environment. (for github)
- 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
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"
- Create an Github App
- Deploy golangci-lint-runner as app somewhere
- set Homepage and Webhook url to your deployment
- create a private key and pass it into golangci-lint-runner
- create a webhook secret and pass it into golangci-lint-runner
- Subscribe to events:
Pull request
- 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...