Upgrade python and pre-commit dependencies #177
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: Upgrade python and pre-commit dependencies | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- dev | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
upgrader: | |
if: ${{ !(contains(github.event.head_commit.message, 'Merge pull request')) }} | |
name: Upgrade dependencies | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: dev | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
cache: pip | |
- name: Get the current week number | |
id: date | |
run: echo "week=$(date +'%U')" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
if: startsWith(runner.os, 'Linux') | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-${{steps.date.outputs.week}} | |
- name: Run pip-compile, install requirements, and pre-commit autoupdate | |
run: | | |
python -m pip install --upgrade pip | |
pip install pip-tools | |
pip-compile -vU | |
pip install -r requirements.txt | |
pre-commit autoupdate | |
pre-commit run --all-files --color always | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: ":arrow_up: Upgrade dependencies" | |
branch: dev | |
commit_user_name: Upgrader | |
commit_user_email: sadikkuzu@hotmail.com | |
commit_author: Upgrader <sadikkuzu@hotmail.com> |