2023-06-03 21:58:54 +00:00
|
|
|
import * as params from './input-params'
|
2023-06-03 20:09:52 +00:00
|
|
|
import * as path from 'path'
|
|
|
|
|
|
|
|
export function workspaceDirectory(): string {
|
|
|
|
return process.env[`GITHUB_WORKSPACE`] || ''
|
|
|
|
}
|
|
|
|
|
|
|
|
export function buildRootDirectory(): string {
|
|
|
|
const baseDirectory = workspaceDirectory()
|
2023-06-03 21:58:54 +00:00
|
|
|
const buildRootDirectoryInput = params.getBuildRootDirectory()
|
2023-06-03 20:09:52 +00:00
|
|
|
const resolvedBuildRootDirectory =
|
|
|
|
buildRootDirectoryInput === ''
|
|
|
|
? path.resolve(baseDirectory)
|
|
|
|
: path.resolve(baseDirectory, buildRootDirectoryInput)
|
|
|
|
return resolvedBuildRootDirectory
|
|
|
|
}
|