Skip to content
filter

GitHub Action

Get JSON Property

v0.2.0 Latest version

Get JSON Property

filter

Get JSON Property

Simple GitHub Action to read a specified property from a JSON file

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Get JSON Property

uses: notiz-dev/github-action-json-property@v0.2.0

Learn more about this action in notiz-dev/github-action-json-property

Choose a version

github-action-json-property

Banner image showing successfully executed GitHub Action

Get a specified property of a json file.

Usage

Use the action inside your workflow yaml file like this:

...
- name: get version
    id: version
    uses: notiz-dev/github-action-json-property@release
    with: 
        path: 'package.json'
        prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}} 
...

Get a nested property value with dot separated prop_path

...
- name: get nested property
    id: format_script
    uses: notiz-dev/github-action-json-property@release
    with: 
        path: 'package.json'
        prop_path: 'scripts.format'
- run: echo ${{steps.format_script.outputs.prop}} 
...

Get a property value as string

...
- name: get nested property
    id: format_script
    uses: notiz-dev/github-action-json-property@release
    with: 
        path: 'package.json'
        prop_path: 'scripts.format'
- run: echo ${{steps.format_script.outputs.propStr}} 
...