2020-06-15 12:59:55 +02:00
|
|
|
import * as path from 'path'
|
|
|
|
|
import * as glob from '@actions/glob'
|
|
|
|
|
|
|
|
|
|
export async function hashFiles(
|
|
|
|
|
baseDir: string,
|
2021-07-05 13:17:31 -06:00
|
|
|
patterns: string[] = ['**'],
|
2020-06-15 12:59:55 +02:00
|
|
|
followSymbolicLinks = false
|
|
|
|
|
): Promise<string | null> {
|
2021-07-05 13:17:31 -06:00
|
|
|
const combinedPatterns = patterns
|
|
|
|
|
.map(pattern => `${baseDir}${path.sep}${pattern}`)
|
|
|
|
|
.join('\n')
|
|
|
|
|
return glob.hashFiles(combinedPatterns, {followSymbolicLinks})
|
2020-06-15 12:59:55 +02:00
|
|
|
}
|