Skip to content

xdfai4x/fetch_variables

Repository files navigation

JSON to variables

This action reads json file and writes its content as environment variables.

Inputs

url

Required The JSON file.

Usage

File content

{
    "value": "value",
    "array": [
        {
            "value": "value 0"
        },
        "value 1"
    ],
    "obj": {
        "value1": "value1",
        "value2": "value2"
    }
}

YML example

- name: JSON to variables
  uses: xdfai4x/fetch_variables@v1.0.0 
  with:
    url: 'http://www.www.com/test.json'
    prefix: 'test'
- name: Show output
  run: echo "The time was ${{ env.test_value }}, ${{ env.test_array_0_value }}, ${{ env.test_obj_value1 }}"

About

action to fetch a json as variables in github workflow

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •