Skip to content

Commit c684256

Browse files
committed
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: golangci/golangci-lint-action#996
1 parent 330284d commit c684256

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/golangci-lint.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: golangci-lint
22
on:
3-
push:
4-
branches:
5-
- main
6-
- master
73
pull_request:
84

95
permissions:
@@ -16,13 +12,15 @@ jobs:
1612
runs-on: ubuntu-latest
1713
steps:
1814
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1917
- uses: actions/setup-go@v5
2018
with:
2119
go-version: stable
2220
- name: golangci-lint
2321
uses: golangci/golangci-lint-action@v6
2422
with:
2523
version: v1.60
26-
only-new-issues: true
27-
args: --timeout=30m
24+
#only-new-issues: true
25+
args: --timeout=30m --new-from-rev=${{ github.event.pull_request.base.sha }}
2826
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)