fix dependency update #11
Workflow file for this run
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 Python Dependencies | |
# on: | |
# schedule: | |
# # Runs at 00:00 UTC every two weeks on Sunday | |
# - cron: '0 0 * * 0/2' | |
# workflow_dispatch: | |
# # Allows manual triggering of the workflow. | |
on: | |
push: | |
branches: | |
- master | |
- dependency-updates | |
# This will trigger the workflow on pushes to the main and develop branches. | |
# You can adjust the branch names as per your workflow requirements. | |
jobs: | |
update-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' # Use the Python version appropriate to your project | |
- name: Generate Date String | |
run: echo "BRANCH_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Install Poetry | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install poetry | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Update Dependencies | |
run: poetry update | |
- name: Create a new branch and push changes | |
run: | | |
git config --global user.name 'CI Bot' | |
git config --global user.email '[email protected]' | |
- name: Create and switch to a new branch | |
run: | | |
git checkout -b update-dependencies-${{ env.BRANCH_DATE }} | |
git add poetry.lock | |
git commit -m "Update dependencies" || echo "No changes to commit" | |
git fetch origin | |
git rebase origin/update-dependencies-2024-03-28 | |
git push --set-upstream origin update-dependencies-${{ env.BRANCH_DATE }} --force | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
branch: update-dependencies-${{ env.BRANCH_DATE }} | |
title: "Update dependencies for ${{ env.BRANCH_DATE }}" | |
body: | | |
Updates dependencies to their latest versions. | |
labels: dependencies,automated PR | |
token: ${{ secrets.GITHUB_TOKEN }} |