diff --git a/.github/actions/poetry_setup/action.yml b/.github/actions/poetry_setup/action.yml index 68b099f0e55..d15ec957844 100644 --- a/.github/actions/poetry_setup/action.yml +++ b/.github/actions/poetry_setup/action.yml @@ -55,11 +55,13 @@ runs: # Refresh the shell hashtable, to ensure correct `which` output. hash -r + PYTHON_MAJOR_MINOR=$(echo "$PYTHON_VERSION" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/') + # `actions/cache@v3` doesn't always seem able to correctly unpack softlinks. # Delete and recreate the softlinks pipx expects to have. rm /opt/pipx/venvs/poetry/bin/python cd /opt/pipx/venvs/poetry/bin - ln -s "$(which "python$PYTHON_VERSION")" python + ln -s "$(which "python$PYTHON_MAJOR_MINOR")" python chmod +x python cd /opt/pipx_bin/ ln -s /opt/pipx/venvs/poetry/bin/poetry poetry