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",
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With