A small shell utility for validating Helm charts in a directory across multiple environment-specific values files.
This utility helps you run helm lint and/or helm template for all Helm charts in a given directory. It is designed for local validation of charts and values files before deployment.
It supports:
- scanning every subdirectory for
Chart.yaml - validating environment-specific
values.<env>.yamlfiles - running one or both modes:
template,lint, orboth
Before using this utility, make sure you have:
- macOS, Linux, or another POSIX-compatible shell environment
bashorzsh- Helm installed and available on your
PATH
To verify Helm is installed:
helm versionYou can install the utility using the included installer script.
git clone https://github.com/<your-user>/helm-validator.git
cd helm-validator./install.shThis script will:
- copy
validate-helm.shto~/global-scripts/validate-helm.sh - make the script executable
- add an alias to your shell config if needed
After install, reload your shell:
source ~/.zshrc # or ~/.bashrc or ~/.bash_profile or ~/.profile depending on your shellThen run:
validate-helmYou can run the validator directly from the repository without installing it.
cd helm-validator
./validate-helm.shYou can also run the script from anywhere if you provide the repository path:
/path/to/helm-validator/validate-helm.shvalidate-helm [options] [directory]When using the script directly:
./validate-helm.sh [options] [directory]-e, --envs: comma-separated list of environments to validate- default:
dev,qa,uat,prd
- default:
-m, --mode:template,lint, orboth- default:
template
- default:
-h, --help: show help information
- Optional directory to validate
- Default: current working directory
validate-helmvalidate-helm -m bothvalidate-helm -e dev,qavalidate-helm ../charts./validate-helm.sh -m both -e dev,qa ../my-chartsFor each chart directory in the target path, the script:
- detects whether
Chart.yamlexists - skips directories without a chart
- checks for
values.<env>.yamlfiles for each requested environment - runs the selected Helm command(s):
helm templatefor rendering templateshelm lintfor chart linting
If any check fails, the script reports the error output and exits with a non-zero status.
✅indicates a passed validation❌indicates a failed validation⚠️indicates a missing values file for a specific environment- The script prints a summary at the end
- If the script cannot access the directory, verify the path and permissions.
- If
helmis not found, install Helm and ensure it is on yourPATH. - If a values file is missing, add
values.<env>.yamlto the chart directory or adjust the--envslist.
- The installer writes to
~/global-scriptsand adds an alias to your shell config only if needed. - If your shell is not
bashorzsh, the installer falls back to~/.bash_profileor~/.profile. - You can customize the target directory and modes without modifying the script.
This repository is licensed under the MIT License. See LICENSE for details.