From 58b33f5ca4c76591f91c0b47e13aa6e389a5a479 Mon Sep 17 00:00:00 2001 From: Ignacio Rodriguez Paez Date: Wed, 11 Nov 2026 10:17:04 +0000 Subject: [PATCH 1/2] Pin GitHub Actions to commit SHAs Sourcegraph-Batch-Change: https://sourcegraph.sourcegraph.com/batch-change-agents/1257 --- .github/workflows/bench.yml | 12 ++++++------ .github/workflows/go.yml | 8 ++++---- .github/workflows/main.yml | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 962cfb0..3b43ec3 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -16,12 +16,12 @@ jobs: timeout-minutes: 15 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0 with: fetch-depth: 0 # to be able to retrieve the last commit in main - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 with: go-version: ${{ matrix.go-version }} @@ -31,7 +31,7 @@ jobs: make bench | tee ${{ github.sha }}_bench_output.txt - name: Get CPU information - uses: kenchan0130/actions-system-info@v1.2.1 + uses: kenchan0130/actions-system-info@fa6e3c44fe5a4d62c5fd1fa589c8a1c898819f2b # v1.2.1 id: system-info - name: Get Main branch SHA @@ -42,13 +42,13 @@ jobs: - name: Get benchmark JSON from main branch id: cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0 with: path: ./cache/benchmark-data.json key: ${{ steps.get-main-branch-sha.outputs.sha }}-${{ runner.os }}-${{ steps.system-info.outputs.cpu-model }}-go-benchmark - name: Compare benchmarks with Main - uses: benchmark-action/github-action-benchmark@v1 + uses: benchmark-action/github-action-benchmark@4322e5726e6334590d251fc4f92bec0efafc45dc # v1.22.2 if: steps.cache.outputs.cache-hit == 'true' with: # What benchmark tool the output.txt came from @@ -66,7 +66,7 @@ jobs: summary-always: true - name: Run benchmarks but don't compare to Main branch - uses: benchmark-action/github-action-benchmark@v1 + uses: benchmark-action/github-action-benchmark@4322e5726e6334590d251fc4f92bec0efafc45dc # v1.22.2 if: steps.cache.outputs.cache-hit != 'true' with: # What benchmark tool the output.txt came from diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f190c54..ac05124 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,10 +17,10 @@ jobs: go-version: ['1.20', 'stable'] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0 - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v3 + uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3.6.1 with: go-version: ${{ matrix.go-version }} @@ -28,7 +28,7 @@ jobs: run: go build -v ./... - name: Lint - uses: golangci/golangci-lint-action@v3.3.1 + uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3.3.1 with: version: latest args: --timeout 5m @@ -37,7 +37,7 @@ jobs: run: go test -race -v ./... -coverprofile ./coverage.txt - name: Codecov - uses: codecov/codecov-action@v3.1.1 + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 with: files: ./coverage.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87e68ae..ee158b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 with: go-version: ${{ matrix.go-version }} @@ -27,7 +27,7 @@ jobs: make bench | tee bench_output.txt - name: Get benchmark as JSON - uses: benchmark-action/github-action-benchmark@v1 + uses: benchmark-action/github-action-benchmark@4322e5726e6334590d251fc4f92bec0efafc45dc # v1.22.2 with: # What benchmark tool the output.txt came from tool: 'go' @@ -40,11 +40,11 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Get CPU information - uses: kenchan0130/actions-system-info@v1.2.1 + uses: kenchan0130/actions-system-info@fa6e3c44fe5a4d62c5fd1fa589c8a1c898819f2b # v1.2.1 id: system-info - name: Save benchmark JSON to cache - uses: actions/cache/save@v3 + uses: actions/cache/save@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0 with: path: ./cache/benchmark-data.json # Save with commit hash to avoid "cache already exists" From 2b52491b162adb63f841a3f9f1015eff73956c77 Mon Sep 17 00:00:00 2001 From: Ignacio Rodriguez Paez Date: Thu, 12 Nov 2026 11:19:24 +0000 Subject: [PATCH 2/2] ci: move to golangci-lint v2 golangci-lint-action v3 can only install golangci-lint v1, and the last v1 release can't read export data from the Go version that 'stable' now installs. v9 of the action installs golangci-lint v2; .golangci.yml was converted with 'golangci-lint migrate' (gosimple is part of staticcheck and typecheck is always on in v2). Amp-Thread-ID: https://ampcode.com/threads/T-01a1cf27-70ef-74c8-9602-faaa0a076243 Co-authored-by: Amp --- .github/workflows/go.yml | 2 +- .golangci.yml | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ac05124..a8dc4e4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,7 +28,7 @@ jobs: run: go build -v ./... - name: Lint - uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3.3.1 + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: version: latest args: --timeout 5m diff --git a/.golangci.yml b/.golangci.yml index ae65a76..15b5213 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,11 +1,28 @@ +version: "2" linters: - disable-all: true + default: none enable: - errcheck - godot - - gosimple - govet - ineffassign - staticcheck - - typecheck - unused + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$