Pre-commit auto-update #17
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: Pre-commit auto-update | |
on: | |
schedule: | |
- cron: "0 8 15 * *" | |
# on demand | |
workflow_dispatch: | |
jobs: | |
auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
cache: "pip" | |
cache-dependency-path: | | |
requirements_production.txt | |
requirements_testing.txt | |
.pre-commit-config.yaml | |
- name: Install dependencies | |
# needed for the mypy hook | |
run: | | |
pip install -r requirements_testing.txt | |
- name: Pre-commit auto-update | |
env: | |
# new branch is created in create-pull-request step | |
SKIP: no-commit-to-branch | |
run: | | |
pre-commit autoupdate | |
- uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: update/pre-commit-hooks | |
title: Update pre-commit hooks | |
commit-message: "update pre-commit hooks" | |
labels: | | |
dependencies | |
body: | | |
Update versions of pre-commit hooks to latest version. | |
Run tests locally to check for conflicts since PRs from GitHub Actions don't trigger workflows. |