Skip to content

Commit

Permalink
chore(actions): Add action to automatically update requirements.txt f…
Browse files Browse the repository at this point in the history
…rom poetry.lock
  • Loading branch information
reemo3dp committed Mar 2, 2024
1 parent 3c7ef0e commit b8c816d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/update_requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Requirements
on:
push:
paths:
- 'packages/**/pyproject.toml'
- 'packages/**/poetry.lock'
branches:
- main

env:
PYTHON_VERSION: 3.x
NODE_VERSION: latest

permissions:
contents: write
id-token: write
pages: write

jobs:
update_requirements:
name: Build pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
working-directory: ./packages/led_effect
run: poetry export -o requirements.txt
# Commit changes
- name: Commit changes
working-directory: ./packages/led_effect
run: |
set -euxo pipefail
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add requirements.txt
git commit -m "chore(led_effect): Update requirements.txt from poetry.lock"
git push origin HEAD:${GITHUB_REF}

0 comments on commit b8c816d

Please sign in to comment.