Add regex validation to string CI inputs
What does this MR do and why?
This MR adds a new optional regex
keyword to CI inputs. It can be used to validate that string inputs match the given pattern. It errors when used with any other input type.
Changelog: added
Screenshots or screen recordings
.gitlab-ci.yml
Regex validation on value provided from This included file requires that the required_test
input be given a string value composed only of letters
When it is given a string with _
, it shows an error message
When it is given a string containing only letters, it passes validation
Regex validation on default value
This included file requires that the default_test
input be given a string value composed only of letters
Because the default value contains a _
, this input will be invalid if not given a value by the including file
If it is given a valid value by the including file, it will pass
Regex validation with invalid type
This included file attempts to use RegEx validation with a boolean input
RegEx validation can only be used with string inputs, so the including file gets an error
How to set up and validate locally
In any project locally, you can use the example configuration files above and check that you get the errors from the screenshots
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #410836 (closed)