I want to pass the env variable from GitHub Action to my config.json file, How to pass the env variables to json file.
In GitHub action secret, I have set Node_Server_Url
one of my IP address.
Config.json
{
"SERVER_URL": "https://{ip}:9000",
}
CodePudding user response:
You could edit your config json files adding this step:
- name: "inject server ip"
env:
server_ip: ${{ secrets.Node_Server_Url }}
run: |
sed -i "s/{ip}/$server_ip/g" config.json