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:
parent
371912eafa
commit
c21ebd7031
4 changed files with 17 additions and 7 deletions
7
dist/save/index.js
vendored
7
dist/save/index.js
vendored
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue