Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/notiz-dev/github-action-json-property
- Owner: notiz-dev
- License: mit
- Created: 2020-03-10T23:18:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T20:41:45.000Z (11 months ago)
- Last Synced: 2024-10-13T14:09:00.627Z (4 months ago)
- Topics: actions, github-actions, json, json-parser
- Language: TypeScript
- Homepage:
- Size: 187 KB
- Stars: 31
- Watchers: 1
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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}}
...```