snok / install-poetry

Github action for installing and configuring Poetry
MIT License
572 stars 53 forks source link

Does not respect POETRY_HOME #127

Closed mahmoudhossam closed 1 year ago

mahmoudhossam commented 1 year ago

I'm trying to install poetry in an alternative location as per the documentation

The problem with this action is that even when POETRY_HOME is set, it still installs to the default location.

Example minimal workflow:

name: Test Install Poetry

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      POETRY_HOME: /usr
    steps:
      - uses: actions/checkout@v3
      - name: Install Poetry
        uses: snok/install-poetry@v1

Example run: https://github.com/mahmoudhossam/test-poetry/actions/runs/5552599337/jobs/10140141699

sondrelg commented 1 year ago

Yeah we hardcoded the path to get around an issue where installation paths would be non-deterministic on certain runners IIRC - it would flip flop between macos and linux on ubuntu-latest locations, or something weird like that.

Perhaps we could honour the POETRY_HOME env var if set. Would you be interested in creating a PR? All relevant code is in the main.sh script.

mahmoudhossam commented 1 year ago

@sondrelg Done.