Skip to content

Commit 8323858

Browse files
committed
lint fixes
1 parent 4f5b356 commit 8323858

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)