'How do I read a json file in a Github Action using a windows hosted runner
I have the following snippet of code to read a json file in a linux hosted runner. How do I do the same using windows?
- id: getParams
run: |
content=`cat ./server.main.params.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
#testing output from the previous command
- name: echo ServerName
run: echo "${{fromJson(steps.getParams.outputs.packageJson).parameters.ServerName.value}}.suffix"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
