https://github.com/yakubique/jsonify-array
Replace field in JSON with its `JSON.stringify()` version
https://github.com/yakubique/jsonify-array
github-actions json stringify
Last synced: about 1 month ago
JSON representation
Replace field in JSON with its `JSON.stringify()` version
- Host: GitHub
- URL: https://github.com/yakubique/jsonify-array
- Owner: yakubique
- License: mit
- Created: 2024-02-28T11:37:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T07:25:31.000Z (over 2 years ago)
- Last Synced: 2025-03-20T15:17:44.741Z (about 1 year ago)
- Topics: github-actions, json, stringify
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# JSONify array
Replace field in JSON with its JSON.stringify() version
[](https://github.com/yakubique/jsonify-array/actions/workflows/test-myself.yaml)
[Usage workflow](https://github.com/yakubique/jsonify-array/actions/workflows/test-myself.yaml)
## Usage
```yaml
- name: JSONify array
uses: yakubique/jsonify-array@v1
with:
input: |
[ { "obj": {"id": 1 } } ]
type: "nested-json"
key: "obj"
# [ { "obj": "{\"id\":1}" } ]
```
## Inputs
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
|-----------|--------|----------|---------------|---------------------------------------------------------------------------|
| input | string | true | | JSON to modify |
| type | string | false | `"flat-json"` | Type of input data `["flat-json", "nested-json"]` (default: "flat-json") |
| key | string | false | | If `type="nested-json"` - which key should
be used |
| from_file | string | false | `"false"` | Load json from file |
| to_file | string | false | `"false"` | Save result to file |
## Outputs
| OUTPUT | TYPE | DESCRIPTION |
|--------|--------|------------------|
| result | string | Filepath or JSON |
----
[](https://ko-fi.com/S6S1UZ9P7)