i am trying to retrieve secrets from github , via github actions workflow
So, i am using toJSON context to set the eNV conetxt in SECRETS
and looping through secret values $secret = “SEC1, SEC2 ”
I have the below in bash and i need help with powershell alterative for the below command
value="$(jq -r --arg key "$secret" '.[$key]' <<< "$SECRETS" | sed 's|.|& |g')"
i tried below
$value = ( jq -r --arg key $value '.[$key]' | $env:SECRETS ) -replace '(.)', '$1 '
But i get
= ( jq -r --arg key $value '.[$key]' | $env:SECRETS ) -repl …
| ~~~~~~~~~~~~
| Expressions are only allowed as the first element of a pipeline.