mirror of
https://github.com/Swatinem/rust-cache
synced 2025-11-04 14:39:11 +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 = "";
|
||||
/** The secondary (restore) key that only contains the prefix and environment */
|
||||
public restoreKey = "";
|
||||
/** If the 'GITHIB_JOB' environemnt variable should be added to the cache name */
|
||||
public useJobKey = true;
|
||||
|
||||
/** Whether to cache CARGO_HOME/.bin */
|
||||
public cacheBin: boolean = true;
|
||||
|
|
@ -69,7 +71,7 @@ export class CacheConfig {
|
|||
}
|
||||
|
||||
const job = process.env.GITHUB_JOB;
|
||||
if (job) {
|
||||
if ((job) && core.useJobKey == true) {
|
||||
key += `-${job}`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue