fetch-schemas command fetches option schemas from multiple git repositories using sparse checkout. This is used in CI to collect schemas from all service repositories before validating option values.
Usage
Arguments
Path to the
repos.json configuration file that specifies which repositories to fetch schemas from.The config file should have this structure:Output directory where fetched schemas will be written.Each repository’s schemas will be extracted to
<OUT>/<namespace>/schema.json.Suppress progress messages. Only errors will be displayed.
repos.json format
The configuration file uses this structure:Map of repository names to their fetch configurations.
GitHub repository URL (HTTPS format).
Path within the repository containing schema directories.Should point to the directory that contains
{namespace}/schema.json files.Git commit SHA to fetch from. This pins the schema version for reproducibility.When updating schemas, update this SHA to point to the commit containing the new schema.
Examples
Basic usage
With quiet mode
CI workflow
Output structure
Given this repos.json:Error handling
Missing or invalid config file
Invalid JSON format
Git command failures
- Network connectivity issues
- Invalid repository URL
- SHA not found in repository (not fetched yet)
- Missing git credentials for private repos
Notes
- The command uses git sparse checkout to efficiently fetch only the schema directories without cloning entire repositories
- SHAs must be pre-fetched in the local git repository (the command runs
git archivewhich requires the SHA to be available locally) - The output directory is created automatically if it doesn’t exist
- Existing files in the output directory will be overwritten
See also
- validate-values - Validate option values against fetched schemas
- CLI overview - Complete CLI reference