Can't use Regular Expression as Input
barrcodes opened this issue · 1 comments
barrcodes commented
Environment
azure-pipelines-task-lib version: 2.9.3
Issue Description
Can't accept regular expression as string input.
Expected behaviour
I would like to allow regular expressions as input.
Actual behaviour
When supplying certain values as input, I receive an exception during decipheriv.update. The following two types of data have caused this exception:
- A string with only one character, i.e.
tmr.setInput('RegExpFlags', 'g');
- A regular expression string, i.e.
tmr.setInput('RegExp', '/versionCode ([0-9]+)/g');
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'encoding' is invalid for data of length 23. Received 'hex'
at validateEncoding (internal/validators.js:153:11)
at Decipheriv.update (internal/crypto/cipher.js:159:3)
at Vault.retrieveSecret (/Users/matthewbarr/repos/alle-regex-transform/node_modules/azure-pipelines-task-lib/vault.js:54:32)
at Object.getInput (/Users/matthewbarr/repos/alle-regex-transform/node_modules/azure-pipelines-task-lib/task.js:200:27)
at Object.<anonymous> (/Users/matthewbarr/repos/alle-regex-transform/index.js:10:24)
Steps to reproduce
- Create a task with at least one input of type string
- Add a line in the task to get the input.
- Create a mocha test case where you set that input to either
- A regular expression
- A single character input
- Create a debug launch config for mocha
- Run debug.
github-actions commented
This issue has had no activity in 90 days. Please comment if it is not actually stale