name: 'Set Python'
description: "Sets python to a specific version"

inputs:
  PYTHON_VERSION:
     description: 'Version of python'
     required: true
     default: python
outputs:
  CI_PYTHON_PATH:
    description: 'Path to the python'
    value: ${{ steps.python_run.outputs.python_path }}
runs:
  using: 'composite'
  steps:
    - name: Output python path
      id: python_run
      shell: bash
      run: python -c "import sys;print('::set-output name=python_path::' + sys.executable)"

    - name: Push to environment
      shell: bash
      run: echo "CI_PYTHON_PATH=${{ steps.python_run.outputs.python_path }}" >> $GITHUB_ENV
