mirror of
https://github.com/actions/setup-go.git
synced 2025-04-24 01:50:52 +00:00
Fix VERSION.cache being reused in test build
This commit is contained in:
parent
10a88fa7b0
commit
b6eca21110
1 changed files with 7 additions and 1 deletions
|
@ -99,7 +99,9 @@ async function acquireGo(version: string, gotipRef: string, bootstrapGo: string)
|
|||
if (!workTree) {
|
||||
// We found gotip.git in cache, but not the work tree.
|
||||
//
|
||||
workTree = path.join(extPath, filename);
|
||||
// Also append commit hash to prevent conflicts with
|
||||
// other checkouts.
|
||||
workTree = path.join(extPath, filename, commitHash);
|
||||
// Work tree must exist, otherwise Git will complain
|
||||
// that “this operation must be run in a work tree”.
|
||||
await io.mkdirP(workTree);
|
||||
|
@ -122,6 +124,10 @@ async function acquireGo(version: string, gotipRef: string, bootstrapGo: string)
|
|||
const env = {
|
||||
'GOROOT_BOOTSTRAP': bootstrap,
|
||||
...process.env,
|
||||
// Tell Git where to look for the repo. Git will be invoked
|
||||
// by cmd/dist to find Go version and write VERSION file.
|
||||
'GIT_DIR': gitDir,
|
||||
'GIT_WORK_TREE': workTree,
|
||||
// Note that while we disable Cgo for tip builds, it does
|
||||
// not disable Cgo entirely. Moreover, we override this
|
||||
// value in setGoEnvironmentVariables with whatever the
|
||||
|
|
Loading…
Add table
Reference in a new issue