-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (58 loc) · 2.24 KB
/
dependencies.yml
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
58
59
60
61
62
63
64
65
66
67
68
---
name: "Update dependencies"
on: # yamllint disable-line rule:truthy
# schedule:
# - cron: '43 16 * * 4'
workflow_dispatch:
jobs:
test:
name: Update dependencies
runs-on: windows-latest
steps:
- name: Checkout repository
# https://github.com/actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version-file: ".python-version"
# Add Scripts directory to the path so that pipenv (and associated
# utilities) can be used once installed
- name: Add python Scripts directory to path
shell: cmd
# Code-page switch is needed to write the env file as utf-8
run: |
chcp 65001
python -c "import site; print(site.USER_SITE.replace('site-packages', 'Scripts'))" >> %GITHUB_PATH%
chcp 1252
- name: Update dependencies
shell: bash
run: uv lock --upgrade --resolution=highest --no-progress > packages.txt
- name: Create update text
shell: bash
run: |
echo 'This is an automated update of the `uv.lock` file.' > updates.txt
echo '' >> updates.txt
echo '```' >> updates.txt
cat packages.txt >> updates.txt
echo '```' >> updates.txt
cat updates.txt
echo 'UPDATES<<EOF' >> $GITHUB_ENV
cat updates.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Create PR to update lockfile
# https://github.com/peter-evans/create-pull-request
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
with:
token: ${{ secrets.PAT_TOKEN }}
add-paths: |
uv.lock
branch: workflow/update-dependencies
delete-branch: true
author: 'GitHub <[email protected]>'
commit-message: '[workflow] Update dependencies in uv.lock'
signoff: true
title: '[workflow] Update dependencies in lockfiles'
labels: dependencies
body: ${{ env.UPDATES }}
draft: false # Set to true to to prevent automerge by Mergify