Action breaks when `.python-version` file specifies multiple versions
Description:
The action breaks if the .python-version file specifies multiple Python versions. This is a supported behavior in pyenv. From pyenv README.md:
You can also specify multiple versions in a
.python-versionfile by hand, separated by newlines.
Action version: v4.7.0
Platform:
- [x] Ubuntu
- [ ] macOS
- [ ] Windows
Runner type:
- [x] Hosted
- [ ] Self-hosted
Tools version: All Python versions affected.
Repro steps:
- Add a
.python-versionfile in the repository with multiple versions specified, one in each line. - Add the action in one of the project's workflow jobs, without explicitly specifying the Python version so that the action falls back to using
.python-versionfile. - Trigger the workflow to run.
Example of failing run: https://github.com/unconventionaldotdev/unbeheader/actions/runs/6320589478/job/17163309443?pr=14#step:4:10
Expected behavior:
The action should take the Python version from the first line of the .python-version file.
Actual behavior:
The action takes the entire .python-version file as the Python version, instead, and fails.
Hello @OmeGak. Thank you for your report. We'll take a look at the issue.
Similar issue is when using pyenv-virtualenv auto-activation like
3.10.13/envs/virtualenv
Unfortunately, Pyenv doesn't feel like to fix the issue (pyenv/pyenv-virtualenv#472).