Skip to content

Commit e3d2ea5

Browse files
authored
Purge cache in cache key (#423)
Fixes: #416
1 parent b3d7ca7 commit e3d2ea5

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

dist/save-cache/index.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup/index.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cache/restore-cache.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
cacheDependencyGlob,
55
cacheLocalPath,
66
cacheSuffix,
7+
pruneCache,
78
pythonVersion as pythonVersionInput,
89
workingDirectory,
910
} from "../utils/inputs";
@@ -55,7 +56,8 @@ async function computeKeys(): Promise<string> {
5556
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
5657
const pythonVersion = await getPythonVersion();
5758
const platform = await getPlatform();
58-
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${cacheDependencyPathHash}${suffix}`;
59+
const pruned = pruneCache ? "-pruned" : "";
60+
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${pruned}${cacheDependencyPathHash}${suffix}`;
5961
}
6062

6163
async function getPythonVersion(): Promise<string> {

src/utils/inputs.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const ignoreEmptyWorkdir =
1717
core.getInput("ignore-empty-workdir") === "true";
1818
export const toolBinDir = getToolBinDir();
1919
export const toolDir = getToolDir();
20-
export const serverUrl = getServerUrl();
20+
export const serverUrl = core.getInput("server-url");
2121
export const githubToken = core.getInput("github-token");
2222

2323
function getEnableCache(): boolean {
@@ -85,7 +85,3 @@ function expandTilde(input: string): string {
8585
}
8686
return input;
8787
}
88-
89-
function getServerUrl(): string {
90-
return core.getInput("server-url");
91-
}

0 commit comments

Comments
 (0)