MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / extractSummaryMeta

Function extractSummaryMeta

packages/bumpy/src/core/changelog-github.ts:174–195  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

172 * These override git-derived info, matching the behavior of @changesets/changelog-github.
173 */
174function 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

Callers 1

createGithubFormatterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…