From 8ef42b17aac9a246dcf31ccc8167ca81f7e6446b Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Wed, 1 Apr 2020 13:48:54 -0500 Subject: [PATCH] WIP --- action.yml | 3 +++ app/main.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a9bdf25..193472f 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,9 @@ inputs: version: description: Explicitly set the version here instead of automatically detecting from `package.json`. Useful for non-JavaScript projects where version may be output by a previous action. required: false + regex_pattern: + description: An optional attribute containing the regular expression used to extract the version number. + required: false outputs: tagname: description: Returns the new tag value. Empty if a tag is not created. diff --git a/app/main.js b/app/main.js index 05b6b51..a12a94c 100644 --- a/app/main.js +++ b/app/main.js @@ -32,7 +32,7 @@ async function run () { break case 'regex': - version = (new Regex(root, new RegExp(pattern, 'i'))).version + version = (new Regex(root, new RegExp(core.getInput('regex_pattern', { required: true }), 'i'))).version break default: