pre-commit autoupdate fails or changes revs in CI
autoupdate contacts each hook repo to find the latest tag and rewrites rev. In CI it can fail on network access to a repo, or produce a config change that a later run rejects if a new rev has an incompatible manifest.
What this error means
A scheduled autoupdate job fails while fetching a repo, or the updated config later fails with an InvalidManifestError at the new rev.
[https://github.com/owner/hook-repo] Cannot update because the tip of the
default branch is not a fetchable rev.
Check the log at /root/.cache/pre-commit/pre-commit.logCommon causes
autoupdate cannot fetch a hook repo
Restricted egress or a repo with no fetchable tag on its default branch makes autoupdate unable to determine the latest rev.
The new rev has an incompatible manifest
autoupdate moved a hook to a rev whose manifest or hook ids changed, so a subsequent run fails.
How to fix it
Run autoupdate where the network is allowed
- Run
pre-commit autoupdateon a step with access to the hook repos. - Review the resulting
revdiff before merging. - Run the hooks once against the new revs to confirm they still work.
- run: pre-commit autoupdate
- run: pre-commit run --all-filesUpdate a single repo deliberately
Bump one repo at a time so an incompatible rev is easy to isolate.
pre-commit autoupdate --repo https://github.com/psf/blackHow to prevent it
- Review autoupdate diffs and run hooks before merging them.
- Allow hook-repo hosts on the autoupdate runner.
- Bump repos individually when a bulk update is risky.