Home

Awesome

create-env-json

This action writes environment variables (or anything you want) to a JSON file that can be accessed by future steps.

Inputs

Output

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:

{"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, 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 }}