Skip to content

loveloper44/render-json-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors