Skip to content

Latest commit

 

History

History
307 lines (222 loc) · 14.5 KB

README.md

File metadata and controls

307 lines (222 loc) · 14.5 KB

Json fields

GitHub Action to filter JSON files by provided fields and operation mode (unique/duplicate)

GitHub marketplace

management: perfekt👌 code style: prettier Mergify Status Reviewed by Hound Chat

DeepSource DeepScan grade GitHub tag (latest by date) GitHub Release Date Lines of code GitHub closed issues GitHub closed pull requests GitHub repo size GitHub last commit GitHub language count GitHub search hit counter GitHub Repository branches GitHub Repository dependents Renovatebot Dependabot NewReleases Hits-of-Code dependencies Status dependencies Status

Codeac Coverage Status codebeat badge Total alerts Language grade: JavaScript codecov CI CircleCI GitHub Super-Linter Commitizen friendly ComVer Public workflows that use this action. Licence

Chat Open questions Open bugs

Table of contents

Description

Typescript Project Status: Active – The project has reached a stable, usable state and is being actively developed. Project created status Project updated status

Processes JSON file by provided list of fields and file source parameters.

Inputs

sourceData

Optional JSON data source file with action parameters:

Complete parameters

[
    {
        "sourceFile": "./data/african_proverbs.json",
        "targetPath": "./data",
        "targetFile": "african_proverbs_unique.json",
        "mode": "unique",
        "jsonPath": "$.african[*]",
        "jsonFields": [
            "text"
        ]
    },
    {
        "sourceFile": "./data/gypsy_proverbs.json",
        "targetPath": "./data",
        "targetFile": "gypsy_proverbs_unique.json",
        "mode": "unique",
        "jsonPath": "$.gypsy[*]",
        "jsonFields": [
            "text"
        ]
    }
]

Basic parameters

[
    {
        "sourceFile": "./data/african_proverbs.json",
        "targetPath": "./data",
        "mode": "unique",
        "jsonPath": "$.african[*]",
        "jsonFields": [
            "text"
        ]
    },
    {
        "sourceFile": "./data/gypsy_proverbs.json",
        "targetPath": "./data",
        "mode": "unique",
        "jsonPath": "$.gypsy[*]",
        "jsonFields": [
            "text"
        ]
    }
]

mode

Required JSON operation mode

unique

Only unique fields must be processed

duplicate

Only duplicate fields must be processed

jsonPath

Required String representing JSON query path ($.property1.property2)

More information on JSON path queries can be found at jsonpath

jsonFields

Optional String representing comma-separated list of fields to process (field1,field2,...,fieldN)

sourceFile

Required Source JSON file to process

targetPath

Required Target path to store processed JSON file

targetFile

Optional Target JSON destination file name (default sourceFile)

Outputs

changed

JSON processing operation status

true

When JSON source file successfully processed and results stored to destination folder

false

When error occurred while processing JSON source file

Examples

- name: Process JSON file by fields
  uses: alexrogalskiy/github-action-json-fields@master
  with:
    mode: 'unique'
    jsonPath: 'african'
    jsonFields: 'text'
    sourceFile: ./data/african_proverbs.json
    targetPath: ./data
    targetFile: african_proverbs_unique.json

Running locally:

  • npm run start:action --action github-action-json-fields --mode 'unique' --jsonPath 'african' --jsonFields 'text' --sourceFile './data/african_proverbs.json' --targetPath './data' --targetFile 'african_proverbs_unique.json'

Visitor stats

GitHub page hits

GitHub stars GitHub forks GitHub watchers

Licensing

Json Fields is distributed under LGPL version 3 or later, [License]. LGPLv3 is additional permissions on top of GPLv3.

license

Authors

Json Fields is maintained by the following GitHub team-members:

  • Author

with community support please contact with us if you have some question or proposition.

Versioning

The project uses SemVer for versioning. For the versions available, see the tags on this repository.

Contribution

Contributors Display

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us (emoji key).

This project follows the all-contributors specification. Contributions of any kind are welcome!

PRs Welcome Github contributors

See also the list of contributors who participated in this project.

Acknowledgement

Stargazers repo roster for @AlexRogalskiy/github-action-json-fields

Forks

Forkers repo roster for @AlexRogalskiy/github-action-json-fields

Development Support

Like Json Fields ? Consider buying me a coffee :)

Become a Patron Buy Me A Coffee KoFi


forthebadge forthebadge forthebadge