Set output venv when activate-environment is used (#627)

Closes: #622
This commit is contained in:
Kevin Stillhammer
2025-10-11 15:17:25 +02:00
committed by GitHub
parent 1a91c3851d
commit bd1f875aba
4 changed files with 26 additions and 9 deletions

View File

@@ -213,15 +213,14 @@ async function activateEnvironment(): Promise<void> {
core.info("Activating python venv...");
await exec.exec("uv", execArgs);
let venvBinPath = `${workingDirectory}${path.sep}.venv${path.sep}bin`;
const venvPath = path.resolve(`${workingDirectory}${path.sep}.venv`);
let venvBinPath = `${venvPath}${path.sep}bin`;
if (process.platform === "win32") {
venvBinPath = `${workingDirectory}${path.sep}.venv${path.sep}Scripts`;
venvBinPath = `${venvPath}${path.sep}Scripts`;
}
core.addPath(path.resolve(venvBinPath));
core.exportVariable(
"VIRTUAL_ENV",
path.resolve(`${workingDirectory}${path.sep}.venv`),
);
core.exportVariable("VIRTUAL_ENV", venvPath);
core.setOutput("venv", venvPath);
}
}