-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathaction.yml
41 lines (41 loc) · 1.2 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "Python Poetry Action"
author: "@abatilo"
description: "An action to run https://github.com/python-poetry/poetry"
branding:
icon: "truck"
color: "gray-dark"
inputs:
poetry-version:
description: "The version of poetry to install"
required: false
default: "latest"
poetry-plugins:
description: "The whitespace/newline-separated list of poetry plugins to install."
required: false
default: ""
runs:
using: "composite"
steps:
- run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
shell: bash
- if: ${{ inputs.poetry-version == 'latest' }}
run: |
pipx install poetry
shell: bash
- if: ${{ inputs.poetry-version == 'main' }}
run: |
pipx install git+https://github.com/python-poetry/poetry.git@main
shell: bash
- if: ${{ inputs.poetry-version != 'latest' && inputs.poetry-version != 'main' }}
run: |
pipx install poetry==${{ inputs.poetry-version }}
shell: bash
- if: ${{ inputs.poetry-plugins != '' }}
run: |
ALL_PLUGINS=$(echo "${{ inputs.poetry-plugins }}")
for PLUGIN in $ALL_PLUGINS; do
poetry self add $PLUGIN
done
shell: bash