Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schdck/create-env-json
GitHub action that writes environment variables (or anything you want) to a JSON
https://github.com/schdck/create-env-json
Last synced: 2 months ago
JSON representation
GitHub action that writes environment variables (or anything you want) to a JSON
- Host: GitHub
- URL: https://github.com/schdck/create-env-json
- Owner: schdck
- License: mit
- Created: 2020-04-01T04:37:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-18T19:25:31.000Z (over 2 years ago)
- Last Synced: 2024-07-08T23:16:09.094Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 903 KB
- Stars: 15
- Watchers: 1
- Forks: 15
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Create a JSON Environment File
- fucking-awesome-actions - Create a JSON Environment File
- awesome-workflows - Create a JSON Environment File
README
# create-env-json
This action writes environment variables (or anything you want) to a JSON file that can be accessed by future steps.
## Inputs
* **[required] `file-name`**: The name of the file to be written.
* **Other variables**: you must specify any other variable you want written to the JSON as input variables. Pass the variable with the name you want to appear in the JSON.## Output
* **`full-path`**: The full path to the written file
## Usage
```
uses: schdck/create-env-json@v1
id: create-env
with:
file-name: 'env.json'
super-secret: ${{ secrets.SuperSecret }}
CONNECTION_STRING: ${{ secrets.connection_string }}
```#### This will generate the following JSON:
``` json
{"super-secret":"[your-super-secret]","CONNECTION_STRING":"[your-connection-string]"}
```You can later pass it's path as an input for another program (e.g. [`claudia.js`](https://claudiajs.com/), which receives a JSON in `--set-env-from-json`)
#### Acessing the full-path
You can later access the full path of the file using `${{ steps.create-env.outputs.full-path }}`