☞ Github Actions to convert variables from a JSON file to workflow ENV variables
Note: This action is supported on all runners operating systems (ubuntu
, macos
, windows
)
-
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.
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
Field | Mandatory | Default Value | Observation |
---|---|---|---|
json_file | YES | N/A | Path to JSON file e.g: ./config.json (when on root) |
☞ If you're interested in contributing to this repository, please follow the guidelines
☞ This repository uses the Apache License 2.0