Skip to content

Update Dependencies #104

Update Dependencies

Update Dependencies #104

name: Update Dependencies
on:
schedule:
- cron: '0 3 * * 1'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
default: 'debug'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Update Poetry dependencies
run: |
git config user.name "dlss-infra-bot"
git config user.email "[email protected]"
git checkout -b update-dependencies
pip install -r requirements.txt
# Update *only* the dependencies in the "main" section of pyproject.toml
# so that apache-airflow (a test dependency) isn't upgraded. The
# apache-airflow version is managed by the Docker image.
poetry update --only main
# if something was committed push it and create a pull request
git commit -m "Updated Python dependencies" poetry.lock
if [ $? -eq 0 ]; then
git push origin update-dependencies
gh pr create --base main --head update-dependencies --title "Updated Python dependencies" --body "Updated Poetry dependencies via Github Action"
else
echo "No Python dependencies need updating"
fi