From a7388fa3226d3334e4441d7dd3e1c1cd19c7f27a Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Fri, 23 May 2025 09:35:31 +0200 Subject: [PATCH] Add prune-cache input to cache key --- dist/save-cache/index.js | 3 ++- dist/setup/index.js | 3 ++- src/cache/restore-cache.ts | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/save-cache/index.js b/dist/save-cache/index.js index a5013a1..f84ed2f 100644 --- a/dist/save-cache/index.js +++ b/dist/save-cache/index.js @@ -88715,7 +88715,8 @@ async function computeKeys() { const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const pythonVersion = await getPythonVersion(); const platform = await (0, platforms_1.getPlatform)(); - return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`; + const pruned = inputs_1.pruneCache ? "-pruned" : ""; + return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`; } async function getPythonVersion() { if (inputs_1.pythonVersion !== "") { diff --git a/dist/setup/index.js b/dist/setup/index.js index c158437..358ddb2 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -121046,7 +121046,8 @@ async function computeKeys() { const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : ""; const pythonVersion = await getPythonVersion(); const platform = await (0, platforms_1.getPlatform)(); - return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`; + const pruned = inputs_1.pruneCache ? "-pruned" : ""; + return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`; } async function getPythonVersion() { if (inputs_1.pythonVersion !== "") { diff --git a/src/cache/restore-cache.ts b/src/cache/restore-cache.ts index f63fc48..dc697dc 100644 --- a/src/cache/restore-cache.ts +++ b/src/cache/restore-cache.ts @@ -4,6 +4,7 @@ import { cacheDependencyGlob, cacheLocalPath, cacheSuffix, + pruneCache, pythonVersion as pythonVersionInput, workingDirectory, } from "../utils/inputs"; @@ -55,7 +56,8 @@ async function computeKeys(): Promise { const suffix = cacheSuffix ? `-${cacheSuffix}` : ""; const pythonVersion = await getPythonVersion(); const platform = await getPlatform(); - return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`; + const pruned = pruneCache ? "-pruned" : ""; + return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`; } async function getPythonVersion(): Promise {