diff --git a/dist/setup/index.js b/dist/setup/index.js index 0d98b66f..32c80098 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -64546,14 +64546,15 @@ function cacheDependencies(cache, pythonVersion) { } function resolveVersionInput() { let version = core.getInput('python-version'); - const versionFile = core.getInput('python-version-file'); + let versionFile = core.getInput('python-version-file'); if (version && versionFile) { core.warning('Both python-version and python-version-file inputs are specified, only python-version will be used'); } if (version) { return version; } - const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFile || '.python-version'); + versionFile = versionFile || '.python-version'; + const versionFilePath = path.join(process.env.GITHUB_WORKSPACE, versionFile); if (!fs_1.default.existsSync(versionFilePath)) { throw new Error(`The specified python version file at: ${versionFilePath} does not exist`); } diff --git a/src/setup-python.ts b/src/setup-python.ts index f5f8c919..8e658706 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -24,7 +24,7 @@ async function cacheDependencies(cache: string, pythonVersion: string) { function resolveVersionInput(): string { let version = core.getInput('python-version'); - const versionFile = core.getInput('python-version-file'); + let versionFile = core.getInput('python-version-file'); if (version && versionFile) { core.warning( @@ -36,10 +36,8 @@ function resolveVersionInput(): string { return version; } - const versionFilePath = path.join( - process.env.GITHUB_WORKSPACE!, - versionFile || '.python-version' - ); + versionFile = versionFile || '.python-version'; + const versionFilePath = path.join(process.env.GITHUB_WORKSPACE!, versionFile); if (!fs.existsSync(versionFilePath)) { throw new Error( `The specified python version file at: ${versionFilePath} does not exist`