Skip to content

Verified to work with python 3.11.4 #15

Verified to work with python 3.11.4

Verified to work with python 3.11.4 #15

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