From e4db522f399f1d1baa73c6e6981c53dd37244ba1 Mon Sep 17 00:00:00 2001 From: Thomas Sundvoll Date: Mon, 3 Jun 2024 22:15:14 +0200 Subject: [PATCH] Add workflow for automatic dependency update --- .github/workflows/compile_requirements.yml | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/compile_requirements.yml diff --git a/.github/workflows/compile_requirements.yml b/.github/workflows/compile_requirements.yml new file mode 100644 index 00000000..a82f2cdf --- /dev/null +++ b/.github/workflows/compile_requirements.yml @@ -0,0 +1,53 @@ +name: Compile Requirements + +on: + push: + branches: + - main + + schedule: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows + # In a public repository, scheduled workflows are automatically disabled when no + # repository activity has occurred in 60 days + - cron: "5 6 * * 1-5" # At 06:05 on every day-of-week from Monday through Friday + +jobs: + compile-requirements: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.deploy_key }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install pip-tools + run: | + python -m pip install --upgrade pip + pip install pip-tools + + - name: Upgrade dependencies and compile requirements file + run: | + pip-compile --output-file=requirements.txt pyproject.toml --upgrade + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "GHA: Update dependencies" + title: Update dependencies + body: | + - Dependency updates + + Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + branch: update-dependencies + labels: automated-pr + delete-branch: true