Official pre-commit hooks for Mergify. Validate Mergify configuration files.
Add the following to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/Mergifyio/mergify-pre-commit
rev: 1.1.0
hooks:
- id: validate-mergify-config-location
- id: validate-mergify-configValidate Mergify configuration files against the official schema.
- Uses
check-jsonschemawith Mergify's schema:https://docs.mergify.com/mergify-configuration-schema.json - Targets files matching the hook's
filespattern.
Customization example (pass extra args to check-jsonschema):
repos:
- repo: https://github.com/Mergifyio/mergify-pre-commit
rev: 1.1.0
hooks:
- id: validate-mergify-config
args: ["--verbose"]Ensure exactly one Mergify configuration file exists in an allowed location.
- Allowed locations (yml only):
.mergify.yml.mergify/config.yml.github/mergify.yml
- Runs as a system shell script, checks repo state (not just staged files).