| 174 | } |
| 175 | |
| 176 | function generateOutput( |
| 177 | importantChanges: ChangelogEntry[], |
| 178 | otherChanges: ChangelogEntry[], |
| 179 | internalChanges: ChangelogEntry[], |
| 180 | contributorsLine: string, |
| 181 | ): string { |
| 182 | const output: string[] = []; |
| 183 | |
| 184 | if (importantChanges.length > 0) { |
| 185 | output.push('### Important Changes', ''); |
| 186 | for (const entry of importantChanges) { |
| 187 | output.push(entry.content, ''); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | if (otherChanges.length > 0) { |
| 192 | output.push('### Other Changes', ''); |
| 193 | for (const entry of otherChanges) { |
| 194 | output.push(entry.content); |
| 195 | } |
| 196 | output.push(''); |
| 197 | } |
| 198 | |
| 199 | if (internalChanges.length > 0) { |
| 200 | output.push('<details>', ' <summary><strong>Internal Changes</strong></summary>', ''); |
| 201 | for (const entry of internalChanges) { |
| 202 | output.push(entry.content); |
| 203 | } |
| 204 | output.push('', '</details>', ''); |
| 205 | } |
| 206 | |
| 207 | if (contributorsLine) { |
| 208 | output.push(contributorsLine); |
| 209 | } |
| 210 | |
| 211 | return output.join('\n'); |
| 212 | } |
| 213 | |
| 214 | // ============================================================================ |
| 215 | // Main |