Skip to content

Commit 95d04e3

Browse files
committed
Fix parsing of Dependabot version bump descriptions
1 parent 24eeb69 commit 95d04e3

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

plugins/filters/extractDependabotVersionBump/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ 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 parsedDesc = JSON.parse(desc);
1823
const matches = regex.exec(parsedDesc);
1924
if (matches && matches.length == 4) {
2025
var [_, action, from, to] = matches;

0 commit comments

Comments
 (0)