Get a specified property of a json file.
...
- name: get version
id: version
uses: mildronize/actions-json-get-key@v1
with:
path: 'package.json'
prop_path: 'version'
- run: echo ${{steps.version.outputs.prop}}
...
...
- name: get nested property
id: format_script
uses: mildronize/actions-json-get-key@v1
with:
path: 'package.json'
prop_path: 'scripts.format'
- run: echo ${{steps.format_script.outputs.prop}}
...
...
- name: get nested property
id: format_script
uses: mildronize/actions-json-get-key@v1
with:
path: 'package.json'
prop_path: 'scripts.format'
output_path: 'version.txt'
- run: cat version.txt
...
Thanks the original: https://github.com/notiz-dev/github-action-json-property