Skip to content

Commit a49f2d9

Browse files
committed
Add GitHub Actions workflow to update requirements.txt on PR merge
1 parent f3a6ca4 commit a49f2d9

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Update requirements.txt on PR merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- master
8+
9+
jobs:
10+
update-requirements:
11+
if: github.event.pull_request.merged == true
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Automatic requirements.txt for Python Project
16+
uses: ryan-rozario/pipreqs-action@master
17+
with:
18+
PROJECT_PATH: project_folder # Replace with the path to your Python project
19+
REQUIREMENT_PATH: project_folder/requirements.txt # Replace with your requirements.txt file path

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
*.pyc
33
.idea*
44
build/
5-
.ipynb_checkpoints*
65
data/
7-
.vscode/
6+
.vscode/
7+
.ipynb_checkpoints*
8+
.ipynb_checkpoints/
9+
.pytest_cache/
10+
venv/
11+
.venv/

0 commit comments

Comments
 (0)