From c684256aadddb66349dac203dc74ad58eae79c7b Mon Sep 17 00:00:00 2001 From: "Sam Wang (holyspectral)" Date: Tue, 29 Oct 2024 10:33:23 -0400 Subject: [PATCH] fix: linter: use new-from-rev When there are more than 20,000 lines in GitHub diff, GitHub will return 406 error and prevent linter from running correctly. This commit uses new-from-rev, so it can generate diff from git repo instead of GitHub API. Related issue: https://github.com/golangci/golangci-lint-action/issues/996 --- .github/workflows/golangci-lint.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 17f81514d..d56a5aa93 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,9 +1,5 @@ name: golangci-lint on: - push: - branches: - - main - - master pull_request: permissions: @@ -16,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-go@v5 with: go-version: stable @@ -23,6 +21,6 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: v1.60 - only-new-issues: true - args: --timeout=30m + #only-new-issues: true + args: --timeout=30m --new-from-rev=${{ github.event.pull_request.base.sha }} github-token: ${{ secrets.GITHUB_TOKEN }}