Skip to content

Commit eb7b073

Browse files
authored
Merge pull request #710 from linear-b/fix-dependabot-version-match
Fix Dependabot version extraction by parsing JSON description
2 parents dab069c + 95d04e3 commit eb7b073

File tree

1 file changed

+7
-1
lines changed
  • plugins/filters/extractDependabotVersionBump

1 file changed

+7
-1
lines changed

plugins/filters/extractDependabotVersionBump/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ module.exports = (desc) => {
1313
if (desc && desc !== '""' && desc !== "''" ) {
1414
// Match both "Bumps" and "Updates" patterns with version numbers
1515
// The regex captures version numbers that follow "from" and "to" keywords
16+
let parsedDesc = desc;
17+
try {
18+
parsedDesc = JSON.parse(desc);
19+
} catch (e) {
20+
// If parsing fails, use the description as is
21+
}
1622
const regex = /(Bumps|Updates).*?from ([\d\.]+[A-Za-zαß]*) to ([\d\.]+[A-Za-zαß]*)/;
17-
const matches = regex.exec(desc);
23+
const matches = regex.exec(parsedDesc);
1824
if (matches && matches.length == 4) {
1925
var [_, action, from, to] = matches;
2026
// Remove trailing dot on the "to" version if present

0 commit comments

Comments
 (0)