From 23d28eaf257ff834861de75c68f6a20ec979b62e Mon Sep 17 00:00:00 2001 From: Robert O'Rourke Date: Fri, 22 Oct 2021 15:31:35 +0100 Subject: [PATCH] feat: support for version constraint prefixes Add support for version constraint prefixes --- action/lib/parse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action/lib/parse.js b/action/lib/parse.js index ac7d72e5..41c8e306 100644 --- a/action/lib/parse.js +++ b/action/lib/parse.js @@ -41,9 +41,9 @@ export default function ({ title, labels = [], config = [], dependencies = {} }) return process.exit(0) // soft exit } - // extract version from the title - const from = title.match(new RegExp('from v?' + regex.semver.source))?.groups - const to = title.match(new RegExp('to v?' + regex.semver.source))?.groups + // 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 if (!to) { core.warning('failed to parse title: no recognizable versions')