Skip to content

Update pre-commit config #31

Update pre-commit config

Update pre-commit config #31

# This is a scheduled workflow to keep pre-commit config up to date
name: Update pre-commit config
on:
schedule:
# Runs at 00:00 UTC on the 1st of every month
- cron: '0 0 1 * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
update:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-20.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@55d479fb1c5bcad5a4f9099a5d9f37c8857b2845 # v2.4.1
with:
egress-policy: audit
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1
with:
python-version: '3.x'
- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
pre-commit install
- name: Update pre-commit config
run: |
pre-commit autoupdate
pre-commit uninstall
- name: Sync `dev-requirements.txt`
run: |
python .github/workflows/update-dev-requirements.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
commit-message: "chore: update pre-commit config"
title: "chore: update pre-commit config"
branch: chore-precommit-config
delete-branch: true
author: GitHub <[email protected]>