mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-27 02:36:20 +08:00
c94d573317
Introducing new actions for the GitHub dependency graph will involve reuse of much of the action infrastructure. This commit reorganises things a little to facilitate reuse.
17 lines
562 B
TypeScript
17 lines
562 B
TypeScript
import * as core from '@actions/core'
|
|
import * as path from 'path'
|
|
|
|
export function workspaceDirectory(): string {
|
|
return process.env[`GITHUB_WORKSPACE`] || ''
|
|
}
|
|
|
|
export function buildRootDirectory(): string {
|
|
const baseDirectory = workspaceDirectory()
|
|
const buildRootDirectoryInput = core.getInput('build-root-directory')
|
|
const resolvedBuildRootDirectory =
|
|
buildRootDirectoryInput === ''
|
|
? path.resolve(baseDirectory)
|
|
: path.resolve(baseDirectory, buildRootDirectoryInput)
|
|
return resolvedBuildRootDirectory
|
|
}
|