Skip to content

Action breaks when .python-version file specifies multiple versions #734

Closed
@OmeGak

Description

@OmeGak

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-version file by hand, separated by newlines.

Action version:
v4.7.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
All Python versions affected.

Repro steps:

  1. Add a .python-version file in the repository with multiple versions specified, one in each line.
  2. 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-version file.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions