Skip to content
chevrons-up

GitHub Action

Pre-commit autoupdate

v1.0.0 Latest version

Pre-commit autoupdate

chevrons-up

Pre-commit autoupdate

Run pre-commit autoupdate and run them on all files

Installation

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

              

- name: Pre-commit autoupdate

uses: browniebroke/[email protected]

Learn more about this action in browniebroke/pre-commit-autoupdate-action

Choose a version

Pre-commit autoupdate action

A Github action to run pre-commit autoupdate and send pull request if any updates is required.

Note

This action can be replaced by a reusable workflow, which reduces the boilerplate needed.

If your project is open source, you might want to consider pre-commit.ci, which runs auto-update weekly on Monday.

Example of workflow:

name: Pre-commit auto-update

on:
  # every day at midnight
  schedule:
    - cron: "0 0 * * *"
  # on demand  
  workflow_dispatch:

jobs:
  auto-update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - uses: actions/setup-python@v2
      
      - uses: browniebroke/pre-commit-autoupdate-action@main
      
      - uses: peter-evans/create-pull-request@v3
        if: always()
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          branch: update/pre-commit-hooks
          title: Update pre-commit hooks
          commit-message: "chore: update pre-commit hooks"
          body: Update versions of pre-commit hooks to latest version.