https://github.com/johnstonmatt/is-valid-json-action
A GitHub action that succeeds if and only if it is pointed at a valid JSON file
https://github.com/johnstonmatt/is-valid-json-action
github-actions javascript json syntax-checker validation
Last synced: 5 months ago
JSON representation
A GitHub action that succeeds if and only if it is pointed at a valid JSON file
- Host: GitHub
- URL: https://github.com/johnstonmatt/is-valid-json-action
- Owner: johnstonmatt
- Created: 2021-11-29T23:22:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-15T04:11:42.000Z (over 3 years ago)
- Last Synced: 2025-07-27T05:27:25.233Z (11 months ago)
- Topics: github-actions, javascript, json, syntax-checker, validation
- Language: JavaScript
- Homepage:
- Size: 680 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# is-valid-json action
This action returns true if a given file is a valid JSON file, otherwise it fails
## Inputs
## `path-to-file`
**Required** The path to the JSON file in your repo to evaluate.
## Outputs
## `is-valid-json`
Whether the provided repo path holds a valid JSON file
## Example usage
```yaml
on:
pull_request:
branches:
- main
jobs:
test_is-valid-json-action:
runs-on: ubuntu-latest
name: A job to test whether the is-valid-json is working properly
steps:
- name: Checkout
uses: actions/checkout@v2
- name: check-validity
uses: johnstonmatt/is-valid-json-action@v.1.0.1
id: check-validity
with:
path-to-file: './test-data/valid.json'
- name: print-validity
run: echo "The valid file was valid JSON"
```
## Notes:
Unlike other environments it is expected that `node_modules` are checked in to `git` when building a GitHub action