Skip to content

GuillaumeFalourd/convert-json-to-env

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

Repository files navigation

Convert JSON to ENV

Public workflows that use this action. Action test on Ubuntu Action test on Macos Action test on Windows

☞ Github Actions to convert variables from a JSON file to workflow ENV variables :octocat:

Note: This action is supported on all runners operating systems (ubuntu, macos, windows)

📚 Usage

⚠️ Requirements

  • The actions/checkout is mandatory to use this action, as it will be necessary to access the JSON file.

  • The JSON file currently only support one level variables. The keys will also be converted to UPPERCASE.

Example

    steps:
      - uses: actions/checkout@v2.3.4
      - uses: GuillaumeFalourd/convert-json-to-env@v1
        with:
          json_file: ./config.json
      - run: echo ${{ env.KEY1 }} #where "key1" is set on the config.json file

▶️ Action Inputs

Field Mandatory Default Value Observation
json_file YES N/A Path to JSON file
e.g: ./config.json (when on root)

🤝 Contributing

☞ If you're interested in contributing to this repository, please follow the guidelines

🏅 Licensed

☞ This repository uses the Apache License 2.0