GitHub Action
Render json
v2.0.2
Latest version
This action render json file with environment variables and return rendered json file path
- uses: loveloper44/[email protected]
id: render
with:
json: jsonFilePath
- name: Get the output
run: echo "${{ steps.render.outputs.result }}"
Create input json file
{
"app": {
"service_id": "%s ENV_SERVICE_ID"
},
"db":{
"host": "%s ENV_DB_HOST",
"port": "%d ENV_DB_PORT",
"user_name": "%s ENV_DB_USER_NAME",
"user_password": "%s ENV_DB_USER_PASSWORD",
}
}
You can use 4 types like below
- %d number
- %s string
- %b boolean
- %f float
Action will render json file with environment variables and return rendered json file path
{
"app": {
"service_id": "TestService"
},
"db":{
"host": "localhost",
"port": 3306,
"user_name": "user",
"user_password": "password",
}
}