diff --git a/scripts/ci-run.sh b/scripts/ci-run.sh index 9c32a3a..92c1042 100755 --- a/scripts/ci-run.sh +++ b/scripts/ci-run.sh @@ -19,6 +19,17 @@ if [ -z "$JOB" ]; then exit 1 fi +# CoreCI's shell-isolated executor (buildIsolatedEnv) does NOT forward +# Go toolchain env vars (GOROOT, GOPATH, GOCACHE, GOMODCACHE are in the +# systemVars deny-list). Re-derive them from the `go` binary on PATH so +# Go commands work in the shell-isolated executor. +if command -v go >/dev/null 2>&1; then + export GOROOT="${GOROOT:-$(go env GOROOT)}" + export GOPATH="${GOPATH:-$(go env GOPATH)}" + export GOCACHE="${GOCACHE:-$(go env GOCACHE)}" + export GOMODCACHE="${GOMODCACHE:-$(go env GOMODCACHE)}" +fi + info() { echo "ci-run: $*"; } err() { echo "ci-run: error: $*" >&2; exit 1; }