snok / install-poetry

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

Add env: section to parse envs that are used in each poetry call #116

Closed fxmb closed 1 year ago

fxmb commented 1 year ago

This is not really an issue but I would like to have a field env: where I can pass in env variables that are available in the virtualenv whenever e.g. poetry run is called. Is this possible somehow? I can obv add these commands every via export XY=abc && poetry run... but this is not concise and easily leads to errors....

sondrelg commented 1 year ago

You can set environment variables in your workflow, like this:

name: Test

on:
    push 

env:
  PYTHON_VERSION: "3.10.5"
  POETRY_VERSION: 1.2.2

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      # run tests here

Would that be enough, or is there a reason that wouldn't work for you?