Co-locate Bazel output base with workspace

Fixes #81
This commit is contained in:
Alex Rodionov 2025-05-15 14:35:35 -07:00
parent 14421f585a
commit 5e310f9e02
5 changed files with 212 additions and 15 deletions

View file

@ -16,7 +16,12 @@ const platform = os.platform()
let bazelOutputBase = core.getInput('output-base')
if (!bazelOutputBase) {
if (platform === 'win32') {
bazelOutputBase = 'D:/_bazel'
// check if GITHUB_WORKSPACE starts with D:
if (process.env.GITHUB_WORKSPACE?.toLowerCase()?.startsWith('d:')) {
bazelOutputBase = 'D:/_bazel'
} else {
bazelOutputBase = `C:/_bazel`
}
} else {
bazelOutputBase = `${homeDir}/.bazel`
}