Skip to content

Commit 94db336

Browse files
authored
Add workflow to update requirements.txt
1 parent 2ad3fb3 commit 94db336

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Update requirements.txt
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- 'pyproject.toml'
7+
workflow_dispatch:
8+
9+
jobs:
10+
update-requirements:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
20+
- name: Install pip-tools
21+
run: pip install pip-tools
22+
23+
- name: Compile requirements
24+
run: pip-compile pyproject.toml -o requirements.txt --resolver=backtracking
25+
26+
- name: Commit changes
27+
run: |
28+
git config --local user.email "action@github.com"
29+
git config --local user.name "GitHub Action"
30+
git add requirements.txt
31+
git diff --staged --quiet || git commit -m "chore: Update requirements.txt"
32+
git push

0 commit comments

Comments
 (0)