Logo
Explore Help
Register Sign In
gradle/actions
1
0
Fork 0
You've already forked actions
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
actions/src/crypto-utils.ts

14 lines
401 B
TypeScript
Raw Normal View History

Automatic caching of dependencies in a best effort manner by default allowing to specify files to hash for computing the cache key
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,
Use built-in library functions in preference to custom implementations - Use built-in `hashFiles` function included in '@actions/globv0.2.0' - Use `downloadTool` and `extractZip` functions from '@actions/tool-cache'
2021-07-05 13:17:31 -06:00
patterns: string[] = ['**'],
Automatic caching of dependencies in a best effort manner by default allowing to specify files to hash for computing the cache key
2020-06-15 12:59:55 +02:00
followSymbolicLinks = false
): Promise<string | null> {
Use built-in library functions in preference to custom implementations - Use built-in `hashFiles` function included in '@actions/globv0.2.0' - Use `downloadTool` and `extractZip` functions from '@actions/tool-cache'
2021-07-05 13:17:31 -06:00
const combinedPatterns = patterns
.map(pattern => `${baseDir}${path.sep}${pattern}`)
.join('\n')
return glob.hashFiles(combinedPatterns, {followSymbolicLinks})
Automatic caching of dependencies in a best effort manner by default allowing to specify files to hash for computing the cache key
2020-06-15 12:59:55 +02:00
}
Reference in New Issue Copy Permalink
由小码云提供计算服务
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API