Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/notiz-dev/github-action-json-property

☕Simple GitHub Action to read a specified property from a JSON file.
https://github.com/notiz-dev/github-action-json-property

actions github-actions json json-parser

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# github-action-json-property

![Banner image showing successfully executed GitHub Action](banner.png)

Get a specified property of a json file.

## Usage

Use the action inside your workflow yaml file like this:

```yaml
...
- 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

```yaml
...
- 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

```yaml
...
- 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}}
...

```