3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-11-07 16:05:05 +00:00

feat: Add conditional lock hash suffix to cache key based on 'add-job-hash' input

This commit is contained in:
Ryan-Brice 2025-10-29 20:57:27 +08:00
parent 371912eafa
commit c21ebd7031
No known key found for this signature in database
GPG key ID: 3702BD1113AFDD13
4 changed files with 17 additions and 7 deletions

7
dist/save/index.js vendored
View file

@ -85595,10 +85595,13 @@ class CacheConfig {
hasher.update(chunk);
}
}
let lockHash = digest(hasher);
keyFiles.push(...parsedKeyFiles);
self.keyFiles = sort_and_uniq(keyFiles);
key += `-${lockHash}`;
// Add lock hash suffix if 'add-job-hash' is true
if (core.getInput("add-job-hash").toLowerCase() == "true") {
let lockHash = digest(hasher);
key += `-${lockHash}`;
}
self.cacheKey = key;
self.cachePaths = [path_1.default.join(exports.CARGO_HOME, "registry"), path_1.default.join(exports.CARGO_HOME, "git")];
if (self.cacheBin) {