Skip to content

Render json

Actions

About

render json file with environment variables
v2.0.2
Latest
Star (11)

render-json-action

This action render json file with environment variables and return rendered json file path

Example usage

- uses: loveloper44/render-json-action@v2.0.2
  id: render
  with:
    json: jsonFilePath

- name: Get the output
  run: echo "${{ steps.render.outputs.result }}"

Json file

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",
  }
}

Render json is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

render json file with environment variables
v2.0.2
Latest

Render json is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.