README Collector
Verify README files exist and analyze their structure including line count and section headings. Enforce documentation standards across your repositories.
readme to your lunar-config.yml:uses: github://earthly/lunar-lib/collectors/readme@v1.0.0
What This Integration Collects
This integration includes 1 collector that gather metadata from your systems.
readme
Scans repository root for README files (README.md, README, README.txt, README.rst)
in order, taking the first match. Extracts line count and section headings by
parsing markdown headers. Writes exists, path, lines, and sections to .repo.readme.
How Collectors Fit into Lunar
Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.
Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.
Learn How Lunar Works →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"repo": {
"readme": {
"exists": true,
"path": "README.md",
"lines": 150,
"sections": [
"Installation",
"Usage",
"API",
"Contributing",
"License"
]
}
}
}
Configuration
Configure this collector in your lunar-config.yml.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
path
|
Optional |
README.md,README,README.txt,README.rst
|
Comma-separated list of README paths to check (first match wins) |
Documentation
View on GitHubREADME Collector
Collects README file information including existence, line count, and section headings.
Overview
This collector scans the repository root for a README file and extracts metadata about its contents, including existence, line count, and section headings. It runs on code changes and checks for common README variants (README.md, README, README.txt, README.rst) in order, which can be customized via the path input.
Collected Data
This collector writes to the following Component JSON paths:
| Path | Type | Description |
|---|---|---|
.repo.readme.exists |
boolean | Whether a README file exists in the repository root |
.repo.readme.path |
string | The path of the README file found (only present if file exists) |
.repo.readme.lines |
number | Number of lines in the README file (only present if file exists) |
.repo.readme.sections[] |
array | List of section headings extracted from the README file (only present if file exists) |
Installation
Add to your lunar-config.yml:
collectors:
- uses: github://earthly/lunar-lib/collectors/readme@v1.0.0
on: ["domain:your-domain"] # Or use tags like [backend, go]
# with:
# path: "README.md,docs/README.md" # Customize which files to check
Open Source
This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Common Use Cases
Explore guardrails that use data from README Collector.
Ready to Automate Your Standards?
See how Lunar can turn your engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.