mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-12-26 02:26:19 +08:00
738bda9866
- Use built-in `hashFiles` function included in '@actions/globv0.2.0' - Use `downloadTool` and `extractZip` functions from '@actions/tool-cache'
14 lines
401 B
TypeScript
14 lines
401 B
TypeScript
import * as path from 'path'
|
|
import * as glob from '@actions/glob'
|
|
|
|
export async function hashFiles(
|
|
baseDir: string,
|
|
patterns: string[] = ['**'],
|
|
followSymbolicLinks = false
|
|
): Promise<string | null> {
|
|
const combinedPatterns = patterns
|
|
.map(pattern => `${baseDir}${path.sep}${pattern}`)
|
|
.join('\n')
|
|
return glob.hashFiles(combinedPatterns, {followSymbolicLinks})
|
|
}
|