Update pre-commit hooks #496
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 pre-commit hooks | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
auto-update: | |
name: Update pre-commit hooks | |
if: ${{ github.repository == 'vacanza/holidays' }} | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
cache: pip | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install pre-commit | |
- name: Use pre-commit environment cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
path: ~/.cache/pre-commit | |
restore-keys: ${{ runner.os }}-pre-commit- | |
- name: Run pre-commit automatic update | |
run: | | |
pre-commit autoupdate | |
pre-commit run --all-files | |
- uses: peter-evans/[email protected] | |
with: | |
base: dev | |
body: Update pre-commit hooks to their latest versions. | |
branch: update-pre-commit-hooks | |
commit-message: 'chore: Update pre-commit hooks' | |
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
delete-branch: true | |
title: Update pre-commit hooks | |
token: ${{ github.token }} |