Refactor shared variable type validation

This commit is contained in:
Andras Bacsai
2024-01-31 13:43:23 +01:00
parent 52fd7ad571
commit f1e4395a83
5 changed files with 7 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ class EnvironmentVariable extends Model
$variable = Str::after($environment_variable, "{$type}.");
$variable = Str::before($variable, '}}');
$variable = Str::of($variable)->trim()->value;
if (!collect(['team', 'project', 'environment'])->contains($type)) {
if (!collect(SHARED_VARIABLE_TYPES)->contains($type)) {
return $variable;
}
if ($type === 'environment') {