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

Function changelogSectionForVersion

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

Source from the content-addressed store, hash-verified

172 * body. Returns null when the section is missing so the caller can fall back
173 * to GitHub's auto-generated notes. */
174const changelogSectionForVersion = async (version: string): Promise<string | null> => {
175 const changelogPath = resolve(cliRoot, "CHANGELOG.md");
176 if (!existsSync(changelogPath)) return null;
177 const lines = (await readFile(changelogPath, "utf8")).split("\n");
178 const start = lines.findIndex((line) => line.trim() === `## ${version}`);
179 if (start === -1) return null;
180 let end = lines.length;
181 for (let i = start + 1; i < lines.length; i += 1) {
182 if (/^## /.test(lines[i] ?? "")) {
183 end = i;
184 break;
185 }
186 }
187 const body = lines
188 .slice(start + 1, end)
189 .join("\n")
190 .trim();
191 return body.length > 0 ? body : null;
192};
193
194const syncGitHubRelease = async (input: {
195 readonly tag: string;

Callers 1

syncGitHubReleaseFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected