From e514b01d25aa060e91bfe1919f4bcb778582535d Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Thu, 10 Sep 2020 18:49:12 -0500 Subject: [PATCH] Add pattern warning. --- README.md | 2 +- app/main.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f6ddafe..e851691 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ The pattern described in this example is a simple one used. If you need a more c `^((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)$` -As of `1.0.3`, JavaScript named patterns are supported, where the group named `version` will be used to populate the tag. For example: +As of `1.1.2`, JavaScript named patterns are supported, where the group named `version` will be used to populate the tag. For example: ```yaml - uses: butlerlogic/action-autotag@1.0.0 diff --git a/app/main.js b/app/main.js index 5f21e10..0e2f5fb 100644 --- a/app/main.js +++ b/app/main.js @@ -34,7 +34,9 @@ async function run () { break case 'regex': - version = (new Regex(root, new RegExp(core.getInput('regex_pattern', { required: false }), 'i'))).version + const pattern = core.getInput('regex_pattern', { required: false }) + core.warning(`Using /${pattern}/gim custom version identification pattern.`) + version = (new Regex(root, new RegExp(pattern, 'gim'))).version break default: