mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-18 00:55:54 +08:00
Hotfix zstd version change only
This commit is contained in:
parent
3630ea6eed
commit
9e06993ffc
11
packages/cache/src/internal/cacheUtils.ts
vendored
11
packages/cache/src/internal/cacheUtils.ts
vendored
@ -99,12 +99,17 @@ async function getVersion(app: string, args?: string[]): Promise<string> {
|
||||
export async function getCompressionMethod(): Promise<CompressionMethod> {
|
||||
const versionOutput = await getVersion('zstd', ['--quiet'])
|
||||
const version = semver.clean(versionOutput)
|
||||
if (version) {
|
||||
|
||||
if (versionOutput === '') {
|
||||
// zstd is not installed
|
||||
return CompressionMethod.Gzip
|
||||
} else if (!version || semver.lt(version, 'v1.3.2')) {
|
||||
// zstd is installed but using a version earlier than v1.3.2
|
||||
// v1.3.2 is required to use the `--long` options in zstd
|
||||
return CompressionMethod.ZstdWithoutLong
|
||||
} else {
|
||||
return CompressionMethod.Gzip
|
||||
return CompressionMethod.Zstd
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export function getCacheFileName(compressionMethod: CompressionMethod): string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user