mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 08:43:55 +08:00
Address PR feedback
This commit is contained in:
parent
97f7baa910
commit
a5d9a3b1a6
6 changed files with 73 additions and 35 deletions
|
@ -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("|"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue