(existingBody: string, metadata: ReleaseMetadata)
| 332 | * preserving the changelog content above. |
| 333 | */ |
| 334 | export function updateReleaseBodyStatus(existingBody: string, metadata: ReleaseMetadata): string { |
| 335 | // Find where the "Published to" section starts |
| 336 | const publishIdx = existingBody.indexOf('#### Published to'); |
| 337 | const metaIdx = existingBody.indexOf(METADATA_START); |
| 338 | |
| 339 | // Determine where changelog content ends |
| 340 | let changelogContent: string; |
| 341 | if (publishIdx !== -1) { |
| 342 | changelogContent = existingBody.slice(0, publishIdx).trimEnd(); |
| 343 | } else if (metaIdx !== -1) { |
| 344 | changelogContent = existingBody.slice(0, metaIdx).trimEnd(); |
| 345 | } else { |
| 346 | changelogContent = existingBody.trimEnd(); |
| 347 | } |
| 348 | |
| 349 | return composeReleaseBody(changelogContent, metadata); |
| 350 | } |
| 351 | |
| 352 | /** Look up an existing GitHub release (draft or published) by tag */ |
| 353 | export async function findReleaseByTag(tag: string, rootDir: string): Promise<DraftReleaseInfo | null> { |
no test coverage detected
searching dependent graphs…