Skip to content

ci: add golangci-lint review dog #2494

ci: add golangci-lint review dog

ci: add golangci-lint review dog #2494

Workflow file for this run

name: Test & Lint
on:
push:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/test_and_lint.yml'
pull_request_target:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/test_and_lint.yml'
jobs:
test-and-lint:
name: Test & Lint
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
steps:
- name: Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- run: go get
- run: go generate ./...
- run: go test -v -race ./...
- run: go vet ./...
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
if: github.event_name != 'pull_request_target'
with:
version: 'v1.61.0'
args: '--timeout 9999s'
skip-cache: true
review-dog:
name: Review Dog
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target'
steps:
# - name: Generate a token
# id: generate-token
# uses: actions/create-github-app-token@v1
# with:
# app-id: ${{ vars.BOT_APP_ID }}
# private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- run: go get
- run: go generate ./...
- name: GolangCI-Lint with review-dog
uses: reviewdog/action-golangci-lint@v2
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tool_name: 'golangci-lint'
level: 'warning'
reporter: 'github-pr-review'
golangci_lint_version: 'v1.61.0'
go_version: '1.22'
cache: false