mirror of
https://github.com/actions/setup-python.git
synced 2024-11-25 01:38:56 +00:00
Fix suggestios done in code review
Rollback a not abot advanced usage on how to use the file and not use the GITHUB_WORKSPACE since it was removed in a previous PR
This commit is contained in:
parent
892baae68b
commit
3d009a5143
2 changed files with 4 additions and 9 deletions
|
@ -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:
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue