Get JSON Property
ActionsTags
(2)Get a specified property of a json file.
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}}
...
Get JSON Property is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.