Skip to content

Pre-commit updater

Pre-commit updater #2

name: Pre-commit updater
on:
workflow_dispatch:
schedule:
# min hour dom month dow
- cron: '0 5 * * 3'
env:
python_version: '3.13'
jobs:
updater:
name: Update
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
raw.githubusercontent.com:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: main
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ env.python_version }}
cache: pip
- name: Install pre-commit
run: python -m pip install pre-commit
- name: Update pre-commit hooks
run: pre-commit autoupdate --freeze
- name: Run pre-commit hooks
run: pre-commit run --all-files
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.PR_CREATOR }}
commit-message: Update pre-commit hooks
branch: pre-commit-update
delete-branch: true
title: 'Update pre-commit hooks'
body: |
This PR was automatically created to make the following update:
- Update pre-commit hooks
labels: |
skip-changelog