Skip to content

Commit 40ac172

Browse files
committed
.github/workflows: force use of local Go toolchain
As of Go version 1.21, the "go" command may, under certain circumstances, fetch a different version of the Go toolchain than is provided locally, as described in git-lfs/git-lfs#5477, PR git-lfs/build-dockers#58, and the Go documentation: https://go.dev/doc/toolchain In general, we do not expect this to occur, as we specify an older Go version in our go.mod file and so the locally-installed Go toolchain should be newer than that version and therefore sufficient. However, to be cautious and ensure we only try to run with the Go version we have specified, we add the GOTOOLCHAIN=local environment variable to all our GitHub Actions workflow jobs. Defining this variable will guarantee that Go will stop with an error rather than proceed to download and run another version of itself.
1 parent 9dc8a29 commit 40ac172

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: CI
22
on: [push, pull_request]
3+
env:
4+
GOTOOLCHAIN: local
35

46
jobs:
57
build-go:

0 commit comments

Comments
 (0)