mirror of
https://github.com/Swatinem/rust-cache
synced 2025-11-05 06:59:13 +00:00
Add useJobKey option for cache naming
Add option to include GITHUB_JOB in cache key.
This commit is contained in:
parent
51dda28b91
commit
f68c22f6e1
1 changed files with 3 additions and 1 deletions
|
|
@ -24,6 +24,8 @@ export class CacheConfig {
|
||||||
public cacheKey = "";
|
public cacheKey = "";
|
||||||
/** The secondary (restore) key that only contains the prefix and environment */
|
/** The secondary (restore) key that only contains the prefix and environment */
|
||||||
public restoreKey = "";
|
public restoreKey = "";
|
||||||
|
/** If the 'GITHIB_JOB' environemnt variable should be added to the cache name */
|
||||||
|
public useJobKey = true;
|
||||||
|
|
||||||
/** Whether to cache CARGO_HOME/.bin */
|
/** Whether to cache CARGO_HOME/.bin */
|
||||||
public cacheBin: boolean = true;
|
public cacheBin: boolean = true;
|
||||||
|
|
@ -69,7 +71,7 @@ export class CacheConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
const job = process.env.GITHUB_JOB;
|
const job = process.env.GITHUB_JOB;
|
||||||
if (job) {
|
if ((job) && core.useJobKey == true) {
|
||||||
key += `-${job}`;
|
key += `-${job}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue