A GitHub action to run poetry update
.
Can be used in workflow which would automatically creates a pull request when updates to one or more dependencies are available.
The Poetry update action will:
- Checkout the caller repository and set up Python.
- Install and configure poetry.
- Check whether there is a
poetry.lock
file in the caller repository, skip update if not. - Run
poetry update
. - Create a PR with a description showing the updated dependencies.
This action is currently compatible only with Python version 3.10 and will install Poetry version 1.8.2.
name: Poetry Update
on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"
# Allow a manual trigger
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: fuzzylabs/gha-poetry-update@v1
If your poetry package installs dependencies from one or more private repository, you will need to configure the SSH key required to access these repositories.
For more information on how to add SSH keys, please refer to Usage section of webfactory/ssh-agent github action.
name: Poetry Update
on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"
# Allow a manual trigger
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.<SSH_PRIVATE_KEY_1> }}
${{ secrets.<SSH_PRIVATE_KEY_2> }}
- uses: fuzzylabs/gha-poetry-update@v1
All inputs are optional. If not set, sensible defaults will be used.
Name | Description | Default |
---|---|---|
python-version |
The python version to use with poetry, the minimum version required is >=3.10 | 3.10.12 |
poetry-version |
The poetry version to use | 1.8.2 |
name: Poetry Update
on:
# Run daily at midnight
schedule:
- cron: "0 0 * * *"
# Allow a manual trigger
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: fuzzylabs/gha-poetry-update@v1
with:
python-version: '3.10.12'
poetry-version: '1.8.2'
This action can also be used on repositories which contain multiple projects in different directories. The following example shows a workflow in which the action updates dependencies in projects in directories project1/
project2
and project3
.
If dependencies are updated in one or more of these projects, a separate pull request will be generated for each of the updated projects.
name: Poetry Update
on:
# Run weekly on Monday at 0700AM
schedule:
- cron: "0 7 * * MON"
# Allow a manual trigger
workflow_dispatch:
jobs:
auto-update:
runs-on: ubuntu-latest
strategy:
matrix: { directory: ['project1/', 'project2/', 'project3/'] }
steps:
- uses: fuzzylabs/gha-poetry-update@v1
with:
python-version: "3.10"
directory: ${{ matrix.directory }}
Note: We do not explicitly support this action with Python <=3.10.4. Though Python 3.10 is checked for as a minimum requirement, this is to capture workflows which set version generically to 3.10.X specifying only major and minor release numbers.