File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,10 +85,19 @@ jobs:
8585 restore-keys : |
8686 ${{ runner.os }}-golangci-lint-
8787
88- # fetch-depth: 0 fetches current branch history; origin/main ref must be fetched separately
88+ # fetch-depth: 0 fetches current branch history; origin/main ref must be fetched separately.
89+ # Use refspec main:main to create a local branch (required for git merge-base main HEAD).
8990 - name : Fetch main branch
9091 if : startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main'
91- run : git fetch origin main
92+ run : git fetch origin main:main
93+
94+ # macOS runners have ~14GB RAM. GOGC=400 lets the Go heap grow to ~31GB (measured), causing
95+ # heavy swap and lint timeout. Cap heap to keep golangci-lint within available physical memory.
96+ - name : Set memory limits (macOS)
97+ if : runner.os == 'macOS'
98+ run : |
99+ echo "GOGC=100" >> "$GITHUB_ENV"
100+ echo "GOMEMLIMIT=10GiB" >> "$GITHUB_ENV"
92101
93102 - name : Check for lint config changes
94103 id : lint-config
You can’t perform that action at this time.
0 commit comments