Skip to content
Latchkey

pre-commit "InvalidManifestError" from a hook repo in CI

pre-commit cloned a hook repo at the pinned rev and tried to read its .pre-commit-hooks.yaml manifest, but the manifest is missing a required field or has an invalid shape at that revision.

What this error means

The run fails with "InvalidManifestError:" naming the cloned repo and the offending key, often a missing entry or language in the manifest at the pinned rev.

pre-commit
An error has occurred: InvalidManifestError:
==> File .pre-commit-hooks.yaml
==> At Hook(id='my-hook')
=====> Missing required key: entry
Check the log at /root/.cache/pre-commit/pre-commit.log

Common causes

The pinned rev predates a manifest field

You pinned rev to a commit where the hook manifest lacked a key that a newer pre-commit requires, so validation fails at that revision.

A malformed local or forked hook manifest

A hand-written .pre-commit-hooks.yaml in a forked repo omits entry, id, or language, or uses a wrong type.

How to fix it

Pin to a rev with a valid manifest

  1. Check the hook repo tags for a release with a complete manifest.
  2. Update rev to that tag.
  3. Re-run so pre-commit clones the corrected revision.
.pre-commit-config.yaml
- repo: https://github.com/owner/hook-repo
  rev: v1.4.0
  hooks:
    - id: my-hook

Fix the manifest in a fork or local hook

Ensure each hook entry declares id, name, entry, and language with valid types.

.pre-commit-hooks.yaml
- id: my-hook
  name: My hook
  entry: my-hook
  language: python

How to prevent it

  • Pin hook repos to tagged releases, not arbitrary commits.
  • Validate forked hook manifests before referencing them.
  • Run pre-commit autoupdate to move to a supported rev deliberately.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →