Add pre-commit auto-update workflow

This commit is contained in:
Matthias
2023-12-21 19:18:50 +01:00
parent 9ec23a0292
commit 3676514ba6

37
.github/workflows/pre-commit-update.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Pre-commit auto-update
on:
# every day at midnight
schedule:
- cron: "0 3 * * 2"
# on demand
workflow_dispatch:
permissions:
pull-requests: write
jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install pre-commit
run: pip install pre-commit
- name: Run auto-update
run: pre-commit autoupdate
- name: Run pre-commit
run: pre-commit run --all-files
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: .pre-commit-config.yaml
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "chore: update pre-commit hooks"
body: Update versions of pre-commit hooks to latest version.