From b43b04ad2463aabb6429c75add399b2491506e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Mon, 9 May 2022 11:11:58 +0200 Subject: [PATCH] Fix version detection The current version detection fails since it's not strict enough. For example, given the PR title "Bump @fontsource/lato from 4.5.5 to 4.5.8": Both "from" and "to" versions are parsed as "4.5.5.", because the word "to" is included in the dependency name as well. Therefore, the corresponding regexes have been adapted to enforce a whitespace prior to the "from" and "to" terms. --- action/lib/parse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action/lib/parse.js b/action/lib/parse.js index 41c8e306..be317826 100644 --- a/action/lib/parse.js +++ b/action/lib/parse.js @@ -42,8 +42,8 @@ export default function ({ title, labels = [], config = [], dependencies = {} }) } // extract version from the title, allowing for constraints (~,^,>=) and v prefix - const from = title.match(new RegExp('from \\D*' + regex.semver.source))?.groups - const to = title.match(new RegExp('to \\D*' + regex.semver.source))?.groups + const from = title.match(new RegExp(' from \\D*' + regex.semver.source))?.groups + const to = title.match(new RegExp(' to \\D*' + regex.semver.source))?.groups if (!to) { core.warning('failed to parse title: no recognizable versions')