Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Specify python-version-file as Absolute Path #430

Closed
5 tasks done
Kurt-von-Laven opened this issue Jun 12, 2022 · 3 comments · Fixed by #431
Closed
5 tasks done

Can't Specify python-version-file as Absolute Path #430

Kurt-von-Laven opened this issue Jun 12, 2022 · 3 comments · Fixed by #431
Labels
bug Something isn't working

Comments

@Kurt-von-Laven
Copy link
Contributor

Kurt-von-Laven commented Jun 12, 2022

Description:
The python-version-file parameter currently only functions correctly with relative paths.

Action version:
v4.0.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
All

Repro steps:
See ScribeMD/slack-templates@e653014 and its accompanying workflow run for a reproduction.

  1. Create a composite action.

  2. Create a .python-version file containing 3.10.4.

  3. Call the setup-python action using an absolute path for the python-version-file:

    - name: Set up Python based on .python-version file.
      uses: actions/setup-python@v4.0.0
      with:
        python-version-file: "${{ github.action_path }}/.python-version"

Expected behavior:
I expected Python 3.10.4 to be set up.

Actual behavior:
The setup-python action crashes with:
Error: The specified python version file at: /home/runner/work/<action_name>/<action_name>/home/runner/work/<action_name>/<action_name>/.python-version does not exist

@vsafonkin
Copy link

Hi @Kurt-von-Laven we will take a look at this.

@vsafonkin
Copy link

vsafonkin commented Jun 13, 2022

@Kurt-von-Laven, as I see you have a typo:
"{{ github.action_path }}/.python-version" -> "${{ github.action_path }}/.python-version"

It works as expected:

- name: Set up Python based on .python-version file.
  uses: actions/setup-python@v4
  with:
    python-version-file: "${{ github.action_path }}/.python-version"

Successful run: https://github.com/vsafonkin/test-repo/runs/6858369737?check_suite_focus=true

@Kurt-von-Laven
Copy link
Contributor Author

Thank you for pointing this out, but the typo was only in my filing of the issue, not the reproduction itself. The particular path I am using is only defined for composite actions, so maybe it’s the empty string otherwise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants