Add pattern warning.

This commit is contained in:
Corey Butler 2020-09-10 18:49:12 -05:00
parent a825539276
commit e514b01d25
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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: