https://github.com/snsinahub/json-to-env
https://github.com/snsinahub/json-to-env
actions environment-variables json open-source
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/snsinahub/json-to-env
- Owner: snsinahub
- License: apache-2.0
- Created: 2022-09-20T14:27:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-05T19:07:28.000Z (over 1 year ago)
- Last Synced: 2025-04-30T17:51:37.580Z (about 1 year ago)
- Topics: actions, environment-variables, json, open-source
- Language: JavaScript
- Homepage:
- Size: 1.32 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-to-env
## Introduction
This action reads environment variables from a JSON file and add them as GitHub Actions environment variables.
### Supported runners
- Linux
- Windows
- MacOS
## Inputs
```YAML
- uses: snsinahub/json-to-env@v2.0.1
with:
# path to json file
# default: ''
# required: true
json_path: ''
```
## Examples
```YAML
- name: checkout
uses: actions/checkout@v3
- name: add env variables
uses: snsinahub/json-to-env@v2.0.1
with:
json_path: "./environments/vars.json"
- name: print env variables
run: |
echo "${{ env.name }}"
```
## Environment file sample
- [env.json](./env.json)