From f68c22f6e1bb1401c156b6bdbe2b5fd294fb1c1d Mon Sep 17 00:00:00 2001 From: Ryan Brice <182604967+Ryan-Brice@users.noreply.github.com> Date: Mon, 13 Oct 2025 13:03:20 +0800 Subject: [PATCH] Add useJobKey option for cache naming Add option to include GITHUB_JOB in cache key. --- src/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index e592916..4837709 100644 --- a/src/config.ts +++ b/src/config.ts @@ -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}`; } }