Repository navigation
57 lines (50 loc) · 1.74 KB
/
Copy pathupdate-python-dependencies.yml
File metadata and controls
57 lines (50 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Update Python dependencies
on:
schedule:
- cron: '0 8 1 * *'
workflow_dispatch:
concurrency:
group: bump-python-dependencies
cancel-in-progress: false
jobs:
update:
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.2
- name: Upgrade script lockfiles
id: upgrade
run: |
uv lock --script build.py --upgrade
uv lock --script .github/scripts/checkver.py --upgrade
if git diff --quiet -- build.py.lock .github/scripts/checkver.py.lock; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
# checkver also runs build.py --discover using its own locked dependencies.
- name: Run scripts with updated dependencies
if: ${{ steps.upgrade.outputs.changed == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
run: uv run --locked .github/scripts/checkver.py
- name: Create dependency update pull request
if: ${{ steps.upgrade.outputs.changed == 'true' }}
uses: peter-evans/create-pull-request@v8
with:
token: ${{ github.token }}
branch: bump-python-dependencies
base: ${{ github.event.repository.default_branch }}
delete-branch: true
add-paths: |
build.py.lock
.github/scripts/checkver.py.lock
commit-message: 'chore(deps): update Python script lockfiles'
sign-commits: true
title: 'chore(deps): bump Python dependencies'
body: |
Monthly update of Python script dependencies.