Skip to content
chevrons-up

GitHub Action

Run pre-commit autoupdate

v1.0.1 Latest version

Run pre-commit autoupdate

chevrons-up

Run pre-commit autoupdate

Runs pre-commit autoupdate, then runs against all files

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Run pre-commit autoupdate

uses: fuzzylabs/[email protected]

Learn more about this action in fuzzylabs/gha-pre-commit-autoupdate

Choose a version

Automated Pre-Commit Updates

A GitHub action to run pre-commit autoupdate and run against all files.

Can be used in workflow to raise a pull request if any updates are required.

This action will:

  1. Checkout the caller repository and set up Python.
  2. Install pre-commit using pip.
  3. Run pre-commit autoupdate.
  4. Run pre-commit to ensure that all pre-commit checks pass after update.
  5. Create a PR

Action inputs

This action takes python version as an optional input, defaulting to 3.10.12 if no input is given.

Name Description Default
python-version The python version to use with pre-commit, the minimum version required is >=3.10.5 3.10.12

Example

The following is an example of how this action might be used in a workflow.

name: Pre-commit autoupdate

on: 
  # Run daily at midnight
  schedule:
    - cron: "0 0 * * *"
  # Allow a manual trigger
  workflow_dispatch:

jobs:
  auto-update:
    runs-on: ubuntu-latest
    steps:
      - uses: fuzzylabs/pre-commit-autoupdate-action@main
        with:
          python_version: "3.11.5"