Skip to content

Commit

Permalink
FileConventions: account for .env prefix
Browse files Browse the repository at this point in the history
When chceking versions in yaml files, correctly process case
when environment variable is referenced using `env.` prefix,
e.g. `env.FOO`.
  • Loading branch information
webwarrior-ws committed Nov 6, 2024
1 parent e318e0a commit 36d807b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/FileConventions/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,15 @@ let private DetectInconsistentVersionsInYamlFiles
yamlDict.Children.["env"]
:?> YamlMappingNode

let envVarName =
let referenceString =
variableRegexMatch.Groups.[1].Value

let envVarName =
if referenceString.StartsWith "env." then
referenceString.[4..]
else
referenceString

match envDict.Children.TryGetValue envVarName
with
| true, envVarValue ->
Expand Down

0 comments on commit 36d807b

Please sign in to comment.