* Build the prefix portions of a changelog line, split into links and thanks * so the bump type tag can be inserted between them.
( info: BumpFileGitInfo, serverUrl: string, repo: string | undefined, includeCommitLink: boolean, thankContributors: boolean, internalAuthors: Set<string>, )
| 313 | * so the bump type tag can be inserted between them. |
| 314 | */ |
| 315 | function formatPrefix( |
| 316 | info: BumpFileGitInfo, |
| 317 | serverUrl: string, |
| 318 | repo: string | undefined, |
| 319 | includeCommitLink: boolean, |
| 320 | thankContributors: boolean, |
| 321 | internalAuthors: Set<string>, |
| 322 | ): { links: string; thanks: string } { |
| 323 | const linkParts: string[] = []; |
| 324 | |
| 325 | if (info.prNumber && info.prUrl) { |
| 326 | linkParts.push(`[#${info.prNumber}](${info.prUrl})`); |
| 327 | } |
| 328 | |
| 329 | if (includeCommitLink && info.commitHash && repo) { |
| 330 | const short = info.commitHash.slice(0, 7); |
| 331 | linkParts.push(`[\`${short}\`](${serverUrl}/${repo}/commit/${info.commitHash})`); |
| 332 | } |
| 333 | |
| 334 | let thanks = ''; |
| 335 | if (thankContributors && info.author && !internalAuthors.has(info.author.toLowerCase())) { |
| 336 | thanks = `Thanks [@${info.author}](${serverUrl}/${info.author})!`; |
| 337 | } |
| 338 | |
| 339 | return { links: linkParts.join(' '), thanks }; |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * Linkify bare issue/PR references like #123 in text, |
no outgoing calls
no test coverage detected
searching dependent graphs…