Merge pull request #10 from schauppi/mLSTM #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update requirements.txt | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- '**/*.py' | |
permissions: write-all | |
jobs: | |
update-requirements: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install pipreqs | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipreqs | |
- name: Generate project specific requirements.txt in src/ | |
run: | | |
pipreqs ./src --force | |
- name: Move requirements.txt to the root directory | |
run: | | |
mv src/requirements.txt ./requirements.txt | |
- name: Commit and push if changes | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add requirements.txt | |
git commit -m "Automatically update requirements.txt with pipreqs" || echo "No changes to commit" | |
git push |