Address PR feedback

This commit is contained in:
Aiqiao Yan 2020-04-30 15:28:04 -04:00
parent 97f7baa910
commit a5d9a3b1a6
6 changed files with 73 additions and 35 deletions

View file

@ -86,13 +86,13 @@ function createHttpClient(): HttpClient {
}
export function getCacheVersion(compressionMethod?: CompressionMethod): string {
// Add salt to cache version to support breaking changes in cache entry
const components = [core.getInput(Inputs.Path, { required: true })].concat(
compressionMethod == CompressionMethod.Zstd
? [compressionMethod, versionSalt]
: versionSalt
compressionMethod == CompressionMethod.Zstd ? [compressionMethod] : []
);
// Add salt to cache version to support breaking changes in cache entry
components.push(versionSalt);
return crypto
.createHash("sha256")
.update(components.join("|"))