Pre-commit auto-update #13
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
# Run a pre-commit autoupdate every week and open a pull request if needed | |
name: Pre-commit auto-update | |
on: | |
# At 00:00 on the 1st of every month. | |
schedule: | |
- cron: "0 0 1 * *" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
pre-commit-auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
- name: Install pre-commit | |
run: pip install pre-commit | |
- name: Run pre-commit | |
run: pre-commit autoupdate | |
- name: Set git config | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ github.token }} | |
branch: update/pre-commit-hooks | |
title: Update pre-commit hooks | |
commit-message: "Update pre-commit hooks" | |
body: Update versions of pre-commit hooks to latest version. | |
labels: "dependencies,github_actions" |