From 1f1f1babc9220ed6e63666db771a27a648ce8e21 Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Tue, 11 Nov 2025 22:27:03 +0200 Subject: [PATCH 1/2] chore(ci): always use go version in .tool-versions setup-go@v6 supports reading in .tool-versions which means we will now always run the same version we run in local dev. This is also a better version to use than go.mod since that is a minimum version. Test Plan: CI --- .github/workflows/go-ci.yml | 5 ++--- .github/workflows/go-lint.yml | 4 ++-- .github/workflows/goreleaser-check.yml | 4 ++-- .github/workflows/goreleaser.yml | 4 ++-- .github/workflows/pr-auditor.yml | 4 ++-- .github/workflows/scip.yml | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 0d3acea806..6fab521aed 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -11,16 +11,15 @@ jobs: go-test: strategy: matrix: - go-version: ['1.25'] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: ${{ matrix.go-version }} + go-version-file: '.tool-versions' - name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph if: runner.os == 'Windows' run: git config --global url."https://$env:PRIVATE_TOKEN@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 7c99b5999f..2e0e818927 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -14,9 +14,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: '1.25' + go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - run: ./dev/go-lint.sh diff --git a/.github/workflows/goreleaser-check.yml b/.github/workflows/goreleaser-check.yml index 45d5c46e47..cf0db12634 100644 --- a/.github/workflows/goreleaser-check.yml +++ b/.github/workflows/goreleaser-check.yml @@ -17,9 +17,9 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: '1.25' + go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - name: Check GoReleaser config diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 72a4a0f825..323b2cc7f9 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -179,9 +179,9 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: 1.25 + go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/" - run: go test ./... diff --git a/.github/workflows/pr-auditor.yml b/.github/workflows/pr-auditor.yml index fe0862e021..b0fd43a054 100644 --- a/.github/workflows/pr-auditor.yml +++ b/.github/workflows/pr-auditor.yml @@ -13,8 +13,8 @@ jobs: with: repository: 'sourcegraph/devx-service' token: ${{ secrets.PR_AUDITOR_TOKEN }} - - uses: actions/setup-go@v5 - with: { go-version: '1.23' } + - uses: actions/setup-go@v6 + with: { go-version-file: '.tool-versions' } - run: 'go run ./cmd/pr-auditor' env: diff --git a/.github/workflows/scip.yml b/.github/workflows/scip.yml index 2df5a1e5c1..8cc30b65b9 100644 --- a/.github/workflows/scip.yml +++ b/.github/workflows/scip.yml @@ -12,9 +12,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@v6 with: - go-version: 1.25 + go-version-file: '.tool-versions' - name: Set directory to safe for git run: git config --global --add safe.directory $GITHUB_WORKSPACE From 82396fabccee48a6cb9fe12731e51a462ec00f8a Mon Sep 17 00:00:00 2001 From: Keegan Carruthers-Smith Date: Tue, 11 Nov 2025 22:41:12 +0200 Subject: [PATCH 2/2] pin latest version of setup-go This isn't a tagged release yet, but supports a feature we want that will be released soon. I am monitoring the upstream issue for when we can switch back to tags. --- .github/workflows/go-ci.yml | 2 +- .github/workflows/go-lint.yml | 2 +- .github/workflows/goreleaser-check.yml | 2 +- .github/workflows/goreleaser.yml | 2 +- .github/workflows/pr-auditor.yml | 2 +- .github/workflows/scip.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml index 6fab521aed..bd79703fe1 100644 --- a/.github/workflows/go-ci.yml +++ b/.github/workflows/go-ci.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: go-version-file: '.tool-versions' - name: (Windows) Enable pulling Go modules from private sourcegraph/sourcegraph diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index 2e0e818927..4fe3c4fca4 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -14,7 +14,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph diff --git a/.github/workflows/goreleaser-check.yml b/.github/workflows/goreleaser-check.yml index cf0db12634..43209622cd 100644 --- a/.github/workflows/goreleaser-check.yml +++ b/.github/workflows/goreleaser-check.yml @@ -17,7 +17,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 323b2cc7f9..588d5e9d90 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -179,7 +179,7 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: go-version-file: '.tool-versions' - name: Enable pulling Go modules from private sourcegraph/sourcegraph diff --git a/.github/workflows/pr-auditor.yml b/.github/workflows/pr-auditor.yml index b0fd43a054..c338878bd9 100644 --- a/.github/workflows/pr-auditor.yml +++ b/.github/workflows/pr-auditor.yml @@ -13,7 +13,7 @@ jobs: with: repository: 'sourcegraph/devx-service' token: ${{ secrets.PR_AUDITOR_TOKEN }} - - uses: actions/setup-go@v6 + - uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: { go-version-file: '.tool-versions' } - run: 'go run ./cmd/pr-auditor' diff --git a/.github/workflows/scip.yml b/.github/workflows/scip.yml index 8cc30b65b9..2d380ae660 100644 --- a/.github/workflows/scip.yml +++ b/.github/workflows/scip.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f with: go-version-file: '.tool-versions'