-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.26 KB
/
update.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
name: "latest pins"
on:
workflow_dispatch:
schedule:
- cron: '25 4,16 * * *'
jobs:
update_pins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Install uv
uses: astral-sh/setup-uv@f064c84ddba8609eaa6f191659f0f166260f175b
with:
version: "0.5.7"
- run: uv --directory ${{ runner.temp }} init
--name install-pinned
--no-workspace
--no-readme
--no-pin-python
--python 3.8
- run: uv --directory ${{ runner.temp }} add --no-sync tox
- run: uv --directory ${{ runner.temp }} export -o ${{ github.workspace }}/requirements.txt
- run: |
if [ -n "$(git status --porcelain)" ]; then
git config --global user.name "install-pinned bot"
git config --global user.email "[email protected]"
git add --all
ver=$(curl -Ls https://pypi.org/pypi/tox/json | jq -r .info.version)
git commit -m "update pins (tox $ver)"
commit=$(git rev-parse HEAD)
sed -i -E "s/@[0-9a-f]{40}.*/@$commit # $ver/g" README.md
git commit -am "update README.md (tox $ver)"
git push
fi