-
Notifications
You must be signed in to change notification settings - Fork 427
46 lines (39 loc) · 1.22 KB
/
export-requirements.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
name: Update requirements.txt file
on:
push:
branches: [ master, staging ]
paths:
- "pyproject.toml"
- "poetry.lock"
jobs:
update:
if: ${{ !github.event.act }} # skip during local actions testing
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install poetry
run: pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
# check-latest: true
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Export requirements.txt
run: poetry export --format requirements.txt --output requirements.txt
- name: Commit changes if any
# Skip this step if being run by nektos/act
if: ${{ !env.ACT }}
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git pull -f
git commit -m "ci: Update requirements.txt" -a
git push
fi