feat: add venv-path input for activate-environment

Allow customizing the venv location while preserving working-directory semantics via --directory.
This commit is contained in:
Kevin Stillhammer 2026-02-03 14:41:13 +01:00
parent 98e1309028
commit 4b51b416f8
No known key found for this signature in database
9 changed files with 151 additions and 15 deletions

View file

@ -14,6 +14,7 @@ export const version = core.getInput("version");
export const versionFile = getVersionFile();
export const pythonVersion = core.getInput("python-version");
export const activateEnvironment = core.getBooleanInput("activate-environment");
export const venvPath = getVenvPath();
export const checkSum = core.getInput("checksum");
export const enableCache = getEnableCache();
export const restoreCache = core.getInput("restore-cache") === "true";
@ -45,6 +46,15 @@ function getVersionFile(): string {
return versionFileInput;
}
function getVenvPath(): string {
const venvPathInput = core.getInput("venv-path");
if (venvPathInput !== "") {
const tildeExpanded = expandTilde(venvPathInput);
return resolveRelativePath(tildeExpanded);
}
return resolveRelativePath(".venv");
}
function getEnableCache(): boolean {
const enableCacheInput = core.getInput("enable-cache");
if (enableCacheInput === "auto") {