This GitHub Action creates a JSON file from environment variables.
File path ending with the new generated file .json
.
Comma-separated string of entity names.
Comma-separated string of entity values.
Change [version]
to the latest version of this GitHub Action.
name: Generate JSON
on:
push:
branches:
- main
jobs:
generate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Generate JSON
id: generate-json
uses: coolusaHD/json-from-env@[version]
with:
file-path: 'output.json'
entity-names: 'name1,NAME_2,NAME_3'
entity-values: 'value1,VALUE_2,${{ secrets.NAME_3 }}'
- name: Upload JSON Artifact
uses: actions/upload-artifact@v3
with:
name: generated-json
path: output.json
The example workflow demonstrates how to use this GitHub Action to generate a JSON file based on your environment variables.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Create a fork of this project, commit your changes and open a pull request.