Skip to content

validate

Check YAML syntax and schema without contacting GitHub.

Terminal window
gh infra validate [path...]

One or more paths can be given. When multiple paths are provided, manifests from all paths are validated together.

ArgumentExampleBehavior
(none) or .gh infra validateAll *.yaml / *.yml in the current directory
Filegh infra validate repos/my-cli.yamlThat file only
Directorygh infra validate repos/All *.yaml / *.yml directly under it (subdirectories are ignored)
Multiplegh infra validate repos/ files/Manifests from all listed paths combined

Overlapping paths (e.g., . and ./repos/) are rejected to prevent duplicate processing.

YAML files that are not gh-infra manifests are silently skipped. Use --fail-on-unknown to treat them as errors.

FlagDescription
--fail-on-unknownError on YAML files with unknown Kind (default: silently skip)
Terminal window
# Validate all files in a directory
gh infra validate ./repos/
# Validate multiple directories at once
gh infra validate ./repos/ ./files/
# Validate a single file
gh infra validate ./repos/my-cli.yaml

Exits with code 0 if all files are valid, non-zero otherwise.