We are moving to GitHub actions (I'm new to actions) and would like to convert the current $json into environment name value pairs. I would like to extract and Name-Value and set/export as windows environment variables. Below is the extract and output of my code. Appreciate any help!
name: Check Build Properties JSON Var File
id: read-json
shell: pwsh
run: |
$jsonfilePath = Get-ChildItem ${{github.workspace }}\buildtools -Recurse | where {$_.name -match 'buildproperties.json'} | % { $_.FullName }
echo "The Value of the declared variable filepath is:- $jsonfilePath"
#$json = Get-Content $jsonfilePath | ConvertFrom-Json
$json = Get-Content $jsonfilePath -Raw
$JsonParameters = ConvertFrom-Json -InputObject $json
This is the current output
the contents of the RAW JSON file from buildTools is: {
"UPACKPATH": "C:\\Users\\builduser\\upack.exe",
"NUGETPATH": "C:\\Users\\builduser\\Nuget.exe",
"NugetPackageUrl": "https://api.nuget.org/v3/index.json",
"SemVer": '1.0.0.0',
"PackagePortal": false
}