Skip to content

Commit

Permalink
add github action to update dependencies using poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Oct 24, 2023
1 parent 353ce6b commit d635df2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
13 changes: 0 additions & 13 deletions .github/dependabot.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Generate requirements.txt for readthedocs

on:
schedule:
- cron: '0 1 * * 1'
push:
workflow_dispatch:

jobs:
update_dependencies:
runs-on: ubuntu-latest
steps:
# Check out repo and set up Python
- uses: actions/checkout@v3
with:
lfs: true

# Use cached python and dependencies, install poetry
- name: "Setup Python, Poetry and Dependencies"
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.8
poetry-version: 1.2.2

# update poetry lockfile
- name: "Update poetry lock file"
id: update
run: |
update_output=$(poetry run poetry update)
echo "update_output=$update_output" >> $GITHUB_OUTPUT
status=$(git status | grep poetry.lock)
echo "status=$status" >> $GITHUB_OUTPUT
# create pull request if necessary
- name: "Create Pull Request"
uses: peter-evans/create-pull-request@v5
if: ${{ steps.update.outputs.status != '' }}
with:
commit-message: Update dependencies
title: "Update dependencies"
body: |
- Dependency updates
${{ steps.update.outputs.update_output }}

0 comments on commit d635df2

Please sign in to comment.