mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-07-29 17:27:46 +00:00
Default to enable-cache: true on GitHub hosted runners (#193)
Closes: #54
This commit is contained in:
committed by
GitHub
parent
3460fe1a9a
commit
e3017a763c
@ -4,7 +4,7 @@ import path from "node:path";
|
||||
export const version = core.getInput("version");
|
||||
export const pythonVersion = core.getInput("python-version");
|
||||
export const checkSum = core.getInput("checksum");
|
||||
export const enableCache = core.getInput("enable-cache") === "true";
|
||||
export const enableCache = getEnableCache();
|
||||
export const cacheSuffix = core.getInput("cache-suffix") || "";
|
||||
export const cacheLocalPath = getCacheLocalPath();
|
||||
export const cacheDependencyGlob = core.getInput("cache-dependency-glob");
|
||||
@ -15,6 +15,14 @@ export const toolBinDir = getToolBinDir();
|
||||
export const toolDir = getToolDir();
|
||||
export const githubToken = core.getInput("github-token");
|
||||
|
||||
function getEnableCache(): boolean {
|
||||
const enableCacheInput = core.getInput("enable-cache");
|
||||
if (enableCacheInput === "auto") {
|
||||
return process.env.RUNNER_ENVIRONMENT === "github-hosted";
|
||||
}
|
||||
return enableCacheInput === "true";
|
||||
}
|
||||
|
||||
function getToolBinDir(): string | undefined {
|
||||
const toolBinDirInput = core.getInput("tool-bin-dir");
|
||||
if (toolBinDirInput !== "") {
|
||||
|
Reference in New Issue
Block a user