From a6d96d5798ed31b61bc8fa1ed51cf600cac85a96 Mon Sep 17 00:00:00 2001 From: Karen Sawrey Date: Fri, 30 Jun 2023 00:40:53 +0200 Subject: [PATCH 1/5] Added a section on input validation --- pages/pipelines/input_step.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pages/pipelines/input_step.md b/pages/pipelines/input_step.md index cb92274ed5..d206b194d8 100644 --- a/pages/pipelines/input_step.md +++ b/pages/pipelines/input_step.md @@ -275,3 +275,22 @@ steps: value: "stable" ``` {: codeblock-file="pipeline.yml"} + +## Input validation + +To prevent the users from entering invalid values when using an input step with text inputs (for example, to gather some deployment information), you can use input validation. + +If you associate a RegEx to a field, the field outline will turn red when an invalid value is entered. + +To do it, use the following sample syntax: + +``` +steps: +- block: "Click me!" + fields: + - text: Must be hexadecimal + key: hex + format: "[0-9a-f]+" +``` + +The format must be a regular expression implicitly anchored to the beginning and end of the input and is functionally equivalent to the [HTML5 pattern attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern). From 9c4a3cc64b4addae6cb8aeeb7b33faf3200f1302 Mon Sep 17 00:00:00 2001 From: Karen Sawrey Date: Fri, 30 Jun 2023 01:02:25 +0200 Subject: [PATCH 2/5] Fixed syntax highlighting Also changed "block" to "input" in the example as we're talking about input step here. Must have been a mistake on the forum. --- pages/pipelines/input_step.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/pipelines/input_step.md b/pages/pipelines/input_step.md index d206b194d8..e67c2f41a6 100644 --- a/pages/pipelines/input_step.md +++ b/pages/pipelines/input_step.md @@ -284,13 +284,13 @@ If you associate a RegEx to a field, the field outline will turn red when an inv To do it, use the following sample syntax: -``` +```yml steps: -- block: "Click me!" - fields: - - text: Must be hexadecimal - key: hex - format: "[0-9a-f]+" + - input: "Click me!" + fields: + - text: Must be hexadecimal + key: hex + format: "[0-9a-f]+" ``` The format must be a regular expression implicitly anchored to the beginning and end of the input and is functionally equivalent to the [HTML5 pattern attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern). From 5c30a86e05db35954fa82275c6aa81ac6561f3a1 Mon Sep 17 00:00:00 2001 From: Karen Sawrey Date: Sat, 8 Jul 2023 00:23:52 +0300 Subject: [PATCH 3/5] Update pages/pipelines/input_step.md Co-authored-by: Michael Belton <119824349+mbelton-buildkite@users.noreply.github.com> --- pages/pipelines/input_step.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/pipelines/input_step.md b/pages/pipelines/input_step.md index e67c2f41a6..a6240888b7 100644 --- a/pages/pipelines/input_step.md +++ b/pages/pipelines/input_step.md @@ -278,7 +278,7 @@ steps: ## Input validation -To prevent the users from entering invalid values when using an input step with text inputs (for example, to gather some deployment information), you can use input validation. +To prevent users from entering invalid text values in input steps (for example, to gather some deployment information), you can use input validation. If you associate a RegEx to a field, the field outline will turn red when an invalid value is entered. From 5881e0392ac897d5ca0c2b5a95723fbf94f46f85 Mon Sep 17 00:00:00 2001 From: Karen Sawrey Date: Sat, 8 Jul 2023 00:24:00 +0300 Subject: [PATCH 4/5] Update pages/pipelines/input_step.md Co-authored-by: Michael Belton <119824349+mbelton-buildkite@users.noreply.github.com> --- pages/pipelines/input_step.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/pipelines/input_step.md b/pages/pipelines/input_step.md index a6240888b7..2e83b09d02 100644 --- a/pages/pipelines/input_step.md +++ b/pages/pipelines/input_step.md @@ -280,7 +280,7 @@ steps: To prevent users from entering invalid text values in input steps (for example, to gather some deployment information), you can use input validation. -If you associate a RegEx to a field, the field outline will turn red when an invalid value is entered. +If you associate a regular expression to a field, the field outline will turn red when an invalid value is entered. To do it, use the following sample syntax: From 2dde66ad5fff1a9c6379b0ec70f08046ac96213c Mon Sep 17 00:00:00 2001 From: Karen Sawrey Date: Sat, 8 Jul 2023 00:24:10 +0300 Subject: [PATCH 5/5] Update pages/pipelines/input_step.md Co-authored-by: Michael Belton <119824349+mbelton-buildkite@users.noreply.github.com> --- pages/pipelines/input_step.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/pipelines/input_step.md b/pages/pipelines/input_step.md index 2e83b09d02..abaee11b45 100644 --- a/pages/pipelines/input_step.md +++ b/pages/pipelines/input_step.md @@ -293,4 +293,4 @@ steps: format: "[0-9a-f]+" ``` -The format must be a regular expression implicitly anchored to the beginning and end of the input and is functionally equivalent to the [HTML5 pattern attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern). +The `format` must be a regular expression implicitly anchored to the beginning and end of the input and is functionally equivalent to the [HTML5 pattern attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern).