From 9c00f9cafd2ca34a4bdde31d2ed480d8ad2f6739 Mon Sep 17 00:00:00 2001 From: mlga Date: Tue, 7 Nov 2023 22:59:29 +0100 Subject: [PATCH] Use GITHUB_WORKFLOW to generate cache key (#15) --- src/cargo.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cargo.ts b/src/cargo.ts index 4a1b178..172ab0c 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -136,6 +136,13 @@ export async function getPrimaryCacheKey() { core.debug(`Hashing target profile = ${cacheTarget}`); hasher.update(cacheTarget); + const workflow = process.env.GITHUB_WORKFLOW; + + if (workflow) { + core.debug(`Hashing GITHUB_WORKFLOW = ${workflow}`); + hasher.update(workflow); + } + const job = process.env.GITHUB_JOB; if (job) {