Skip to content

Commit

Permalink
fix: linter: use new-from-rev
Browse files Browse the repository at this point in the history
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:

golangci/golangci-lint-action#996
  • Loading branch information
holyspectral committed Oct 29, 2024
1 parent 330284d commit c684256
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
Expand All @@ -16,13 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: stable
- name: golangci-lint
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 }}

0 comments on commit c684256

Please sign in to comment.