Version changes #12
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: Generate Requirements | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'pyproject.toml' | |
- 'poetry.lock' | |
jobs: | |
update-requirements: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Allows pushing changes to the repository | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Ensure full history is fetched to allow pushing commits | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create false | |
- name: Regenerate requirements.txt | |
run: | | |
poetry lock | |
poetry export -f requirements.txt --output requirements.txt --without-hashes | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add requirements.txt | |
# Check if there are changes to commit | |
if git diff-index --quiet HEAD --; then | |
echo "No changes to commit." | |
else | |
git commit -m "Auto-update requirements.txt [skip ci]" | |
git push | |
fi |