Purge cache in cache key (#423)

Fixes: #416
This commit is contained in:
Kevin Stillhammer
2025-05-23 09:43:52 +02:00
committed by GitHub
parent b3d7ca7ac0
commit e3d2ea5ff3
4 changed files with 10 additions and 16 deletions

View File

@ -4,6 +4,7 @@ import {
cacheDependencyGlob,
cacheLocalPath,
cacheSuffix,
pruneCache,
pythonVersion as pythonVersionInput,
workingDirectory,
} from "../utils/inputs";
@ -55,7 +56,8 @@ async function computeKeys(): Promise<string> {
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<string> {

View File

@ -17,7 +17,7 @@ export const ignoreEmptyWorkdir =
core.getInput("ignore-empty-workdir") === "true";
export const toolBinDir = getToolBinDir();
export const toolDir = getToolDir();
export const serverUrl = getServerUrl();
export const serverUrl = core.getInput("server-url");
export const githubToken = core.getInput("github-token");
function getEnableCache(): boolean {
@ -85,7 +85,3 @@ function expandTilde(input: string): string {
}
return input;
}
function getServerUrl(): string {
return core.getInput("server-url");
}