Update dependencies with pip-tools #122
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Action to run pip-compile weekly and create a Pull Request with the changes. | |
# Although GitHub says that pip-compile is supported by dependabot, we couldn't make it work together. | |
# That's why this action exists. | |
# If we ever find the proper configuration for dependabot+pip-compile, | |
# we can delete this action. | |
name: Update dependencies with pip-tools | |
on: | |
schedule: | |
# Run weekly on day 0 at 00:00 UTC | |
- cron: "0 0 * * 0" | |
permissions: | |
contents: read | |
jobs: | |
update-dependencies: | |
permissions: | |
contents: write # to create branch (peter-evans/create-pull-request) | |
pull-requests: write # to create a PR (peter-evans/create-pull-request) | |
name: Update dependencies | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'readthedocs' # do not run this job on forks | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update submodules | |
run: git submodule update --init | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install "pg_config" requirement | |
run: sudo apt-get install libpq-dev | |
- name: Install piptools and invoke | |
# Pinning pip==24.2 due to https://github.com/jazzband/pip-tools/issues/2131 | |
run: python -m pip install --upgrade pip-tools invoke pip==24.2 | |
- name: Update dependencies from requirements/*.txt | |
run: invoke requirements.update | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
add-paths: | | |
requirements/*.txt | |
title: | | |
Dependencies: all packages updated via pip-tools | |
body: | | |
Dependencies: all packages updated via pip-tools | |
commit-message: | | |
Dependencies: all packages updated via pip-tools | |
delete-branch: true | |
branch: dependencies/pip-tools | |
branch-suffix: short-commit-hash |