@@ -38,11 +38,34 @@ Just two tools needed:
38382 . Create the required files:
3939 - ` Chart.yaml ` - Chart metadata
4040 - ` values.yaml ` - Default configuration values
41- - ` README.md ` - Chart documentation
41+ - ` README.md.gotmpl ` - Chart documentation template (NOT README.md!)
4242 - ` templates/ ` - Kubernetes manifest templates
4343
44443 . Follow the [ chart structure requirements] ( #chart-structure-requirements )
4545
46+ ## Documentation (IMPORTANT)
47+
48+ ** DO NOT EDIT ` README.md ` FILES DIRECTLY!**
49+
50+ All chart README.md files are automatically generated from ` README.md.gotmpl ` templates:
51+
52+ - Edit ` charts/<chart>/README.md.gotmpl ` instead of ` README.md `
53+ - The ` docs.yaml ` workflow automatically generates README.md from the template
54+ - Any manual edits to README.md will be overwritten on the next push
55+
56+ To update documentation:
57+ 1 . Modify the appropriate ` .gotmpl ` file
58+ 2 . Run ` helm-docs ` locally to preview: ` helm-docs --chart-search-root=charts `
59+ 3 . Commit both the template changes and generated README.md
60+
61+ ### Adding Documentation to Templates
62+
63+ When editing ` README.md.gotmpl ` :
64+ - Use Helm template functions: ` {{ template "chart.version" . }} `
65+ - Include installation examples with OCI registry
66+ - Add configuration tables with default values
67+ - The template will be processed with chart metadata automatically
68+
4669## Chart Structure Requirements
4770
4871Each chart must include:
@@ -51,7 +74,8 @@ Each chart must include:
5174charts/<chart-name>/
5275├── Chart.yaml # Required: Chart metadata
5376├── values.yaml # Required: Default values
54- ├── README.md # Required: Documentation
77+ ├── README.md # Generated: Documentation (DO NOT EDIT)
78+ ├── README.md.gotmpl # Required: Documentation template
5579├── templates/ # Required: Template files
5680│ ├── _helpers.tpl # Template helpers
5781│ ├── NOTES.txt # Post-install notes
@@ -134,6 +158,16 @@ When making changes:
134158- Unit tests using helm-unittest
135159- Integration tests with chart-testing
136160
161+ # ## Documentation Enforcement
162+
163+ **Important**: The repository has automated safeguards for documentation:
164+
165+ 1. **Pre-commit hooks** : Run `helm-docs` automatically to ensure README.md matches templates
166+ 2. **CI/CD workflow** : The `docs.yaml` workflow will overwrite any manual README.md changes
167+ 3. **PR comments** : If documentation is out of date, the CI will add a warning comment to the PR
168+
169+ **Rule**: Always edit `README.md.gotmpl`, never `README.md` directly!
170+
137171# ## Running Tests Locally
138172
139173` ` ` bash
0 commit comments