validate
Check YAML syntax and schema without contacting GitHub.
gh infra validate [path...]One or more paths can be given. When multiple paths are provided, manifests from all paths are validated together.
| Argument | Example | Behavior |
|---|---|---|
(none) or . | gh infra validate | All *.yaml / *.yml in the current directory |
| File | gh infra validate repos/my-cli.yaml | That file only |
| Directory | gh infra validate repos/ | All *.yaml / *.yml directly under it (subdirectories are ignored) |
| Multiple | gh 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.
| Flag | Description |
|---|---|
--fail-on-unknown | Error on YAML files with unknown Kind (default: silently skip) |
Examples
Section titled “Examples”# Validate all files in a directorygh infra validate ./repos/
# Validate multiple directories at oncegh infra validate ./repos/ ./files/
# Validate a single filegh infra validate ./repos/my-cli.yamlExits with code 0 if all files are valid, non-zero otherwise.