- 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.
12 lines
518 B
TypeScript
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`
|
|
}
|