openpencil/tools/release-packages/src/release-notes.ts
Danila Poyarkov 54c1373d3e
ci: derive GitHub Release metadata from changelog (#536)
- Extract the release body from the changelog section matching the pushed tag.\n- Keep the GitHub Release title identical to the tag.\n- Document signing, updater, publication, deployment, and Homebrew handoff.
2026-08-17 11:07:13 +03:00

12 lines
518 B
TypeScript

import { parseChangelog } from 'changelog-parser'
export async function readReleaseNotes(path: string, version: string): Promise<string> {
const changelog = await parseChangelog({ filePath: path, removeMarkdown: false })
const release = changelog.versions.find((entry) => entry.version === version)
if (!release) throw new Error(`Changelog section not found for ${version}`)
const notes = release.body.trim()
if (!notes) throw new Error(`Changelog section is empty for ${version}`)
return `${notes}\n`
}