From 8a29a083f6aca4d6bd90a4d4e3989731e9895bce Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 9 Dec 2023 06:57:31 +0000 Subject: [PATCH] Fix (ci): Comment out secret env vars in `.env` in generated branches (#179) Fixes bug in #152 --- Generate-GitBranches.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Generate-GitBranches.ps1 b/Generate-GitBranches.ps1 index 45d15349..37730cc0 100644 --- a/Generate-GitBranches.ps1 +++ b/Generate-GitBranches.ps1 @@ -128,7 +128,7 @@ function Get-EnvFileKv ($file, $branch) { if ($branchFiles -contains $file) { $content = { git --no-pager show "${branch}:${file}" } | Execute-Command $content | % { - if ($_ -match '^(\w+)=(.*)$') { + if ($_ -match '^#*\s*(\w+)=(.*)$') { $kv[$matches[1]] = $matches[2] }else { throw "File '$file' is not in a valid k=v format. Invalid line: $_" @@ -221,11 +221,11 @@ NO_PULL= NO_TEST= NO_PUSH= DOCKER_REPOSITORY=$( $g['docker_repository'] ) -REGISTRY_USER= -REGISTRY_PASSWORD= +#REGISTRY_USER= +#REGISTRY_PASSWORD= STEAM_LOGIN= -STEAM_USERNAME= -STEAM_PASSWORD= +#STEAM_USERNAME= +#STEAM_PASSWORD= "@ | Out-File .env -Encoding utf8 -Force $kv = Get-EnvFileKv '.state' $branch