MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / changelogSectionForVersion

Function changelogSectionForVersion

apps/cli/src/release.ts:199–217  ·  view source on GitHub ↗
(version: string)

Source from the content-addressed store, hash-verified

197 * body. Returns null when the section is missing so the caller can fall back
198 * to GitHub's auto-generated notes. */
199const changelogSectionForVersion = async (version: string): Promise<string | null> => {
200 const changelogPath = resolve(cliRoot, "CHANGELOG.md");
201 if (!existsSync(changelogPath)) return null;
202 const lines = (await readFile(changelogPath, "utf8")).split("\n");
203 const start = lines.findIndex((line) => line.trim() === `## ${version}`);
204 if (start === -1) return null;
205 let end = lines.length;
206 for (let i = start + 1; i < lines.length; i += 1) {
207 if (/^## /.test(lines[i] ?? "")) {
208 end = i;
209 break;
210 }
211 }
212 const body = lines
213 .slice(start + 1, end)
214 .join("\n")
215 .trim();
216 return body.length > 0 ? body : null;
217};
218
219const syncGitHubRelease = async (input: {
220 readonly tag: string;

Callers 1

syncGitHubReleaseFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected