Skip to content

prek Autoupdate

Runs prek autoupdate to bump all hook revisions in prek.toml to their latest versions, then opens a pull request with the changes via peter-evans/create-pull-request.

Usage

yaml
jobs:
  autoupdate:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/prek-autoupdate.yml@main
    secrets: inherit

Inputs

InputTypeDefaultDescription
branchstringchore/prek-autoupdateBranch name for the autoupdate PR
labelsstring''Comma-separated labels to add to the PR (e.g. dependencies,chore)
git-namestring''Git committer name — falls back to GIT_USER_NAME variable, then github-actions[bot]
git-emailstring''Git committer email — falls back to GIT_USER_EMAIL variable, then the Actions noreply address

Secrets

SecretRequiredDescription
PAT_TOKENPersonal Access Token with contents:write and pull-requests:write scopes

Schedule

This workflow also fires automatically every Monday at 06:00 UTC via a built-in schedule trigger:

yaml
on:
  schedule:
    - cron: '0 6 * * 1'
  workflow_dispatch:

jobs:
  autoupdate:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/prek-autoupdate.yml@main
    secrets: inherit

Notes

  • Requires prek configuration in prek.toml.
  • If prek autoupdate produces no changes, no PR is opened.
  • The committer identity on the resulting commit can be customized via git-name / git-email inputs or via repository variables GIT_USER_NAME / GIT_USER_EMAIL.