* Extract metadata lines (pr, commit, author) from a bump file summary. * These override git-derived info, matching the behavior of @changesets/changelog-github.
(summary: string)
| 172 | * These override git-derived info, matching the behavior of @changesets/changelog-github. |
| 173 | */ |
| 174 | function extractSummaryMeta(summary: string): { cleanSummary: string; overrides: SummaryOverrides } { |
| 175 | const overrides: SummaryOverrides = {}; |
| 176 | |
| 177 | const cleaned = summary |
| 178 | .replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => { |
| 179 | const num = Number(pr); |
| 180 | if (!isNaN(num)) overrides.pr = num; |
| 181 | return ''; |
| 182 | }) |
| 183 | .replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => { |
| 184 | overrides.commit = commit; |
| 185 | return ''; |
| 186 | }) |
| 187 | .replace(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => { |
| 188 | overrides.authors ??= []; |
| 189 | overrides.authors.push(user); |
| 190 | return ''; |
| 191 | }) |
| 192 | .trim(); |
| 193 | |
| 194 | return { cleanSummary: cleaned, overrides }; |
| 195 | } |
| 196 | |
| 197 | // ---- Git/PR info resolution ---- |
| 198 |
no outgoing calls
no test coverage detected
searching dependent graphs…