Summary
PR #168 fails markdown linting because CHANGELOG.md lacks a version entry, causing release-please to mangle the file structure.
Root Cause
When release-please's updateContent() method runs on a CHANGELOG.md that has no version entry matching its regex ('\n###? v?[0-9[]'), it takes the "no version found" code path which:
- Prepends
# Changelog\n header
- Adds the new changelog entry
- Calls
adjustHeaders() on all existing content (including frontmatter)
- Appends the adjusted content at the end of the file
This results in the YAML frontmatter being pushed to the bottom of the file, causing these markdown lint failures:
- MD003:
--- misinterpreted as setext heading style
- MD012: Multiple consecutive blank lines
- MD022: Headings not surrounded by blank lines
- MD013: Line too long (description field)
Solution
Seed CHANGELOG.md with a ## 0.0.0 (Initial) placeholder version entry. This triggers release-please's "version found" path which uses:
const before = content.slice(0, lastEntryIndex);
This preserves everything before the first version header, including YAML frontmatter.
Affected PR
References
Summary
PR #168 fails markdown linting because CHANGELOG.md lacks a version entry, causing release-please to mangle the file structure.
Root Cause
When release-please's
updateContent()method runs on a CHANGELOG.md that has no version entry matching its regex ('\n###? v?[0-9[]'), it takes the "no version found" code path which:# Changelog\nheaderadjustHeaders()on all existing content (including frontmatter)This results in the YAML frontmatter being pushed to the bottom of the file, causing these markdown lint failures:
---misinterpreted as setext heading styleSolution
Seed CHANGELOG.md with a
## 0.0.0 (Initial)placeholder version entry. This triggers release-please's "version found" path which uses:This preserves everything before the first version header, including YAML frontmatter.
Affected PR
References
updateContent()algorithm