diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 718a4f5..9bdd456 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -242,7 +242,7 @@ jobs: The python-version-file input accepts a path to a file containing the version of Python to be used by a project, for example .python-version, or .tool-versions. If both the python-version and the python-version-file inputs are provided then the python-version input is used. -> The action will search for the python version file relative to the repository root. +> In case both `python-version` and `python-version-file` inputs are supplied, the `python-version-file` input will be ignored due to its lower priority. ```yaml steps: diff --git a/src/setup-python.ts b/src/setup-python.ts index 1ef7506..a10b751 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -37,18 +37,13 @@ function resolveVersionInput() { } if (versionFile) { - const versionFilePath = path.join( - process.env.GITHUB_WORKSPACE!, - versionFile - ); - - if (!fs.existsSync(versionFilePath)) { + if (!fs.existsSync(versionFile)) { throw new Error( - `The specified python version file at: ${versionFilePath} doesn't exist.` + `The specified python version file at: ${versionFile} doesn't exist.` ); } - const version = parsePythonVersionFile(fs.readFileSync(versionFilePath, 'utf8')); + const version = parsePythonVersionFile(fs.readFileSync(versionFile, 'utf8')); core.info(`Resolved ${versionFile} as ${version}`); return [version];