2023-06-03 17:58:54 -04:00
|
|
|
import * as params from './input-params'
|
2023-06-03 16:09:52 -04: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 17:58:54 -04:00
|
|
|
const buildRootDirectoryInput = params.getBuildRootDirectory()
|
2023-06-03 16:09:52 -04:00
|
|
|
const resolvedBuildRootDirectory =
|
|
|
|
buildRootDirectoryInput === ''
|
|
|
|
? path.resolve(baseDirectory)
|
|
|
|
: path.resolve(baseDirectory, buildRootDirectoryInput)
|
|
|
|
return resolvedBuildRootDirectory
|
|
|
|
}
|