mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-25 17:51:02 -05: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.
16 lines
558 B
TypeScript
16 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
|
|
}
|