mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-23 01:22:50 +00:00
c211be411e
- Do not restore cache when GUH exists - Include RUNNER_OS in the cache key - Do not save cache on exact hit - Only save cache in the final post action - Log before saving cache
37 lines
998 B
TypeScript
37 lines
998 B
TypeScript
import * as exec from '@actions/exec'
|
|
|
|
export async function execute(
|
|
executable: string,
|
|
root: string,
|
|
argv: string[]
|
|
): Promise<BuildResult> {
|
|
let publishing = false
|
|
let buildScanUrl: string | undefined
|
|
|
|
const status: number = await exec.exec(executable, argv, {
|
|
cwd: root,
|
|
ignoreReturnCode: true,
|
|
listeners: {
|
|
stdline: (line: string) => {
|
|
if (line.includes('Publishing build scan...')) {
|
|
publishing = true
|
|
}
|
|
if (publishing && line.startsWith('http')) {
|
|
buildScanUrl = line.trim()
|
|
publishing = false
|
|
}
|
|
}
|
|
}
|
|
})
|
|
|
|
return new BuildResultImpl(status, buildScanUrl)
|
|
}
|
|
|
|
export interface BuildResult {
|
|
readonly status: number
|
|
readonly buildScanUrl?: string
|
|
}
|
|
|
|
class BuildResultImpl implements BuildResult {
|
|
constructor(readonly status: number, readonly buildScanUrl?: string) {}
|
|
}
|