Update dependencies #5
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
name: Update dependencies | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" # Every Monday morning | |
jobs: | |
update_deps: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.DEPENDABOT_PAT }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" # Cached by GitHub (https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#python) | |
cache: "pip" | |
cache-dependency-path: | | |
./uv.lock | |
- name: Install uv | |
run: | | |
python -m pip install --upgrade pip | |
pip install uv | |
- name: Update dependencies | |
run: | | |
uv sync --upgrade | |
- name: Check for uv.lock changes | |
run: | | |
git config --global user.name "dependabot[bot]" | |
git config --global user.email "49699333+dependabot[bot]@users.noreply.github.com" | |
git add ./uv.lock | |
if git diff --cached --exit-code --quiet; then | |
echo "No changes in uv.lock" | |
echo "deps_change=false" >> $GITHUB_ENV | |
else | |
echo "Changes detected in uv.lock" | |
echo "deps_change=true" >> $GITHUB_ENV | |
fi | |
- name: Commit changes | |
if: env.deps_change == 'true' | |
run: | | |
git commit -m "chore: update python dependencies" | |
git push -f origin HEAD:deps/update-python-dependencies | |
- name: Create Pull Request | |
if: env.deps_change == 'true' | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.DEPENDABOT_PAT }} | |
branch: deps/update-python-dependencies | |
title: "[Deps] Update python dependencies" | |
body: "Update python dependencies" | |
assignees: "Jordan-Kowal" |