mirror of
https://github.com/actions/toolkit.git
synced 2026-08-15 00:00:25 +02:00
React to feedback
This commit is contained in:
+13
-7
@@ -86,14 +86,20 @@ export async function getCompressionMethod(): Promise<CompressionMethod> {
|
||||
if (process.platform === 'win32' && !isGnuTarInstalled()) {
|
||||
// Disable zstd due to bug https://github.com/actions/cache/issues/301
|
||||
return CompressionMethod.Gzip
|
||||
}
|
||||
|
||||
const versionOutput = await getVersion('zstd')
|
||||
const version = semver.clean(versionOutput)
|
||||
|
||||
if (!versionOutput.toLowerCase().includes('zstd command line interface')) {
|
||||
// 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 {
|
||||
const versionOutput = await getVersion('zstd')
|
||||
const version = semver.clean(versionOutput)
|
||||
return !versionOutput.toLowerCase().includes('zstd command line interface')
|
||||
? CompressionMethod.Gzip
|
||||
: !version || semver.lt(version, 'v1.3.2')
|
||||
? CompressionMethod.ZstdOld
|
||||
: CompressionMethod.Zstd
|
||||
return CompressionMethod.Zstd
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user