init commit #1
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 from poetry.lock | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
update-requirements: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12.1" | |
- name: Install poetry | |
run: | | |
pip install "poetry>=1.7,<1.8" | |
poetry self add poetry-plugin-export | |
- name: Update dependencies and commit to remote | |
run: | | |
poetry export --format requirements.txt --output requirements.txt | |
git config user.name cyscom-github-actions | |
git config user.email [email protected] | |
git add requirements.txt | |
if [ git diff --cached --exit-code ]; then | |
echo "Files have changed!" | |
git commit -m "Updated dependencies in requirements.txt file" | |
git push | |
else | |
echo "requirements.txt" has not changed | |
fi |