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: