()
| 216 | // ============================================================================ |
| 217 | |
| 218 | function run(): void { |
| 219 | const changelogPath = join(__dirname, '..', 'CHANGELOG.md'); |
| 220 | const changelogContent = readFileSync(changelogPath, 'utf-8'); |
| 221 | const unreleasedLines = getUnreleasedSection(changelogContent); |
| 222 | |
| 223 | // Parse existing changelog entries |
| 224 | const { importantChanges, otherChanges, internalChanges, changelogPRs, contributorsLine } = |
| 225 | parseChangelog(unreleasedLines); |
| 226 | |
| 227 | // Add new git commits that aren't already in the changelog |
| 228 | for (const commit of getNewGitCommits()) { |
| 229 | const prNumber = extractPRNumber(commit); |
| 230 | |
| 231 | // Skip duplicates |
| 232 | if (prNumber && changelogPRs.has(prNumber)) { |
| 233 | continue; |
| 234 | } |
| 235 | |
| 236 | const entry = createEntry(commit, isInternalCommit(commit) ? 'internal' : 'other'); |
| 237 | |
| 238 | if (entry.type === 'internal') { |
| 239 | internalChanges.push(entry); |
| 240 | } else { |
| 241 | otherChanges.push(entry); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | // Sort all categories |
| 246 | sortEntries(importantChanges); |
| 247 | sortEntries(otherChanges); |
| 248 | sortEntries(internalChanges); |
| 249 | |
| 250 | // eslint-disable-next-line no-console |
| 251 | console.log(generateOutput(importantChanges, otherChanges, internalChanges, contributorsLine)); |
| 252 | } |
| 253 | |
| 254 | // ============================================================================ |
| 255 | // Helper Functions |
no test coverage detected