From 366e467938fd946a2c84c39218fce301016df30c Mon Sep 17 00:00:00 2001 From: Jay Bazuzi Date: Tue, 14 May 2024 14:41:10 -0700 Subject: [PATCH] . e Workflow to update all Python dependencies --- .../workflows/Update Python Dependencies.yml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/Update Python Dependencies.yml diff --git a/.github/workflows/Update Python Dependencies.yml b/.github/workflows/Update Python Dependencies.yml new file mode 100644 index 0000000..5901608 --- /dev/null +++ b/.github/workflows/Update Python Dependencies.yml @@ -0,0 +1,41 @@ +on: + schedule: + # Runs at 05:00 UTC every Monday + - cron: '0 5 * * 1' + workflow_dispatch: + +jobs: + update-dependencies: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pip-tools + + - name: Update dependencies + run: | + pip-compile --upgrade + + - name: Configure Git + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + + - name: Commit updates + run: | + git commit -am "- r Update Python dependencies" || echo "No changes to commit" + git push + + - name: Create Pull Request + run: | + gh pr create -B main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}