File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Update requirements.txt
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ update-reqs :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v5
18+ with :
19+ python-version : ' 3.12'
20+
21+ - name : Install pipreqs
22+ run : pip install pipreqs
23+
24+ - name : Update requirements.txt
25+ run : pipreqs . --force --ignore .venv
26+
27+ - name : Commit and push if changed
28+ run : |
29+ git config --global user.name "github-actions[bot]"
30+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
31+ git add requirements.txt
32+ if git diff --cached --quiet; then
33+ echo "No changes in requirements.txt"
34+ else
35+ git commit -m "Updated requirements.txt"
36+ git push
37+ fi
You can’t perform that action at this time.
0 commit comments