mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-02 04:13:17 +08:00
Change variable path to a list
This commit is contained in:
12
packages/cache/src/internal/cacheHttpClient.ts
vendored
12
packages/cache/src/internal/cacheHttpClient.ts
vendored
@@ -84,10 +84,10 @@ function createHttpClient(): HttpClient {
|
||||
}
|
||||
|
||||
export function getCacheVersion(
|
||||
inputPath: string,
|
||||
paths: string[],
|
||||
compressionMethod?: CompressionMethod
|
||||
): string {
|
||||
const components = [inputPath].concat(
|
||||
const components = paths.concat(
|
||||
compressionMethod === CompressionMethod.Zstd ? [compressionMethod] : []
|
||||
)
|
||||
|
||||
@@ -102,11 +102,11 @@ export function getCacheVersion(
|
||||
|
||||
export async function getCacheEntry(
|
||||
keys: string[],
|
||||
inputPath: string,
|
||||
paths: string[],
|
||||
options?: CacheOptions
|
||||
): Promise<ArtifactCacheEntry | null> {
|
||||
const httpClient = createHttpClient()
|
||||
const version = getCacheVersion(inputPath, options?.compressionMethod)
|
||||
const version = getCacheVersion(paths, options?.compressionMethod)
|
||||
const resource = `cache?keys=${encodeURIComponent(
|
||||
keys.join(',')
|
||||
)}&version=${version}`
|
||||
@@ -177,11 +177,11 @@ export async function downloadCache(
|
||||
// Reserve Cache
|
||||
export async function reserveCache(
|
||||
key: string,
|
||||
inputPath: string,
|
||||
paths: string[],
|
||||
options?: CacheOptions
|
||||
): Promise<number> {
|
||||
const httpClient = createHttpClient()
|
||||
const version = getCacheVersion(inputPath, options?.compressionMethod)
|
||||
const version = getCacheVersion(paths, options?.compressionMethod)
|
||||
|
||||
const reserveCacheRequest: ReserveCacheRequest = {
|
||||
key,
|
||||
|
||||
5
packages/cache/src/internal/cacheUtils.ts
vendored
5
packages/cache/src/internal/cacheUtils.ts
vendored
@@ -38,11 +38,6 @@ export function getArchiveFileSize(filePath: string): number {
|
||||
return fs.statSync(filePath).size
|
||||
}
|
||||
|
||||
export function logWarning(message: string): void {
|
||||
const warningPrefix = '[warning]'
|
||||
core.info(`${warningPrefix}${message}`)
|
||||
}
|
||||
|
||||
export async function resolvePaths(patterns: string[]): Promise<string[]> {
|
||||
const paths: string[] = []
|
||||
const workspace = process.env['GITHUB_WORKSPACE'] ?? process.cwd()
|
||||
|
||||
Reference in New Issue
Block a user