This repo showcases a lightweight YAML workflow for Kubernetes/Helm content. It combines:
yamlfmtto normalize formattingyamllintfor structural/style validation in CIlefthookto enforce yamlfmt in pre-commit
charts/demo/ # Sample Helm chart (templates intentionally skipped by linting)
manifests/ # YAML used to test formatter/linter
.github/workflows/ # Github Actions Definition
mise install
lefthook installYAML Validation (see .github/workflows/yaml-lint.yaml) runs on pull requests touching YAML or lint configs. Steps:
- Detect changed YAML/config files.
- Install Python + yamllint via pip
- Run
yamllinteither on the full repo (when configs change) or only on changed files.
The workflow intentionally mirrors local expectations so developers see the same failures locally and in CI.
- If
yamlfmtcomplains about Helm templates, ensure your hooks excludecharts/*/templates/**. - Set
LEFTHOOK=0temporarily if you need to bypass hooks for emergency commits, but restore it afterwards to keep the workflow enforceable.