From f6b2ec967788a48bd70caf39c77502407861b0ce Mon Sep 17 00:00:00 2001 From: Felipe Lalanne Date: Fri, 30 Jul 2021 21:54:30 +0000 Subject: [PATCH] Improve validation messages for env vars and labels Change-type: patch --- src/types/basic.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/types/basic.ts b/src/types/basic.ts index cc63fe4f..fe5d4a6b 100644 --- a/src/types/basic.ts +++ b/src/types/basic.ts @@ -96,7 +96,11 @@ export const VariableName = new t.Type( chain((s) => VAR_NAME_REGEX.test(s) ? t.success(s) - : t.failure(s, c, "may only contain alphanumeric chars plus '_'"), + : t.failure( + s, + c, + "needs to start with a letter and may only contain alphanumeric characters plus '_'", + ), ), ), t.identity, @@ -121,7 +125,7 @@ export const LabelName = new t.Type( : t.failure( s, c, - "may only contain alphanumeric chars plus '-' and '.'", + "needs to start with a letter and may only contain alphanumeric characters plus '-' and '.'", ), ), ),