mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-26 01:46:18 +08:00
07023d3e3e
Moved reading of all input parameters into a common source: `input-params.ts`. This centralized all input parameter reads, and allowed an improved implementation of reading boolean parameters. In particular, the implementation now provides a default value for a boolean input parameter that isn't declared for an action.
17 lines
558 B
TypeScript
17 lines
558 B
TypeScript
import * as params from './input-params'
|
|
import * as path from 'path'
|
|
|
|
export function workspaceDirectory(): string {
|
|
return process.env[`GITHUB_WORKSPACE`] || ''
|
|
}
|
|
|
|
export function buildRootDirectory(): string {
|
|
const baseDirectory = workspaceDirectory()
|
|
const buildRootDirectoryInput = params.getBuildRootDirectory()
|
|
const resolvedBuildRootDirectory =
|
|
buildRootDirectoryInput === ''
|
|
? path.resolve(baseDirectory)
|
|
: path.resolve(baseDirectory, buildRootDirectoryInput)
|
|
return resolvedBuildRootDirectory
|
|
}
|