Create update-uv-lock.yml
This commit is contained in:
parent
7a2f33509d
commit
4f1ec7fa4e
1 changed files with 52 additions and 0 deletions
52
.github/workflows/update-uv-lock.yml
vendored
Normal file
52
.github/workflows/update-uv-lock.yml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
name: Update uv.lock on version bump
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'pyproject.toml'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-lock:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.13'
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v3
|
||||||
|
|
||||||
|
- name: Update uv.lock
|
||||||
|
run: uv sync
|
||||||
|
|
||||||
|
- name: Check for changes
|
||||||
|
id: changes
|
||||||
|
run: |
|
||||||
|
if git diff --quiet uv.lock; then
|
||||||
|
echo "changed=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "No changes to uv.lock"
|
||||||
|
else
|
||||||
|
echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "uv.lock has been updated"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit and push uv.lock
|
||||||
|
if: steps.changes.outputs.changed == 'true'
|
||||||
|
run: |
|
||||||
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local user.name "github-actions[bot]"
|
||||||
|
git add uv.lock
|
||||||
|
git commit -m "chore: update uv.lock after version bump [skip ci]"
|
||||||
|
git push
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue