-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (37 loc) · 1.16 KB
/
recreate-poetry-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
on:
pull_request:
paths:
- 'pyproject.toml'
- 'poetry.lock'
- 'requirements.txt'
permissions:
contents: write
jobs:
regenerate_requirements_txt:
name: Regenerating the requirements.txt file
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9.x'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.6.1
- name: Checkout the repository - but just the relevant files
uses: actions/checkout@v4
with:
sparse-checkout: |
requirements.txt
pyproject.toml
poetry.lock
- name: Generate new lock file
run: poetry lock
- name: Generate new requirements.txt file
run: poetry export --without-hashes -f requirements.txt -o requirements.txt
- name: Committing the changes back to the branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Regenerating requirements.txt file