summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-06-04 17:36:40 +0200
committermfluharty <mfluharty@gitlab.com>2019-06-06 15:46:45 +0100
commit432d24ac9a84700ed5d1d798f705c2a1e40903dd (patch)
tree25ae5f3a035927e5673f2d89f04d97037e360f02
parentff3486a92bfcf00b85d45c9224c27cc5fa9c49e2 (diff)
downloadgitlab-ce-432d24ac9a84700ed5d1d798f705c2a1e40903dd.tar.gz
Expose javascript regex
-rw-r--r--app/helpers/ci_variables_helper.rb4
-rw-r--r--doc/ci/variables/README.md3
2 files changed, 5 insertions, 2 deletions
diff --git a/app/helpers/ci_variables_helper.rb b/app/helpers/ci_variables_helper.rb
index e313015c937..3f01ed5669e 100644
--- a/app/helpers/ci_variables_helper.rb
+++ b/app/helpers/ci_variables_helper.rb
@@ -27,4 +27,8 @@ module CiVariablesHelper
%w(File file)
]
end
+
+ def ci_variable_maskable_regex
+ Maskable::REGEX.inspect.sub('\\A', '^').sub('\\z', '$').sub(/^\//, '').sub(/\/[a-z]*$/, '')
+ end
end
diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md
index b17ad625c9e..df455857dee 100644
--- a/doc/ci/variables/README.md
+++ b/doc/ci/variables/README.md
@@ -92,10 +92,9 @@ This means that the value of the variable will be hidden in job logs,
though it must match certain requirements to do so:
- The value must be in a single line.
-- The value must contain only letters, numbers, or underscores.
+- The value must only consist of characters from the Base64 alphabet, defined in [RFC4648](https://tools.ietf.org/html/rfc4648).
- The value must be at least 8 characters long.
- The value must not use variables.
-- The value must only consist of characters from the Base64 alphabet, defined in [RFC4648](https://tools.ietf.org/html/rfc4648).
If the value does not meet the requirements above, then the CI variable will fail to save.
In order to save, either alter the value to meet the masking requirements