3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-11-10 01:32:03 +00:00

Refactor cache key logic to use input for job key

Replace direct use of 'useJobKey' property with input retrieval for flexibility.
This commit is contained in:
Ryan Brice 2025-10-13 13:07:10 +08:00 committed by GitHub
parent c33320fb91
commit 5788d5f736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,8 +24,6 @@ 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;
@ -71,7 +69,7 @@ export class CacheConfig {
}
const job = process.env.GITHUB_JOB;
if ((job) && core.useJobKey == true) {
if ((job) && core.getInput("use-job-key").toLowerCase() == "true") {
key += `-${job}`;
}
}