Skip to content

Commit

Permalink
ci: action to validate networks JSON (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Jun 14, 2023
1 parent 78aeeac commit d3c1cd4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate Networks JSON

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install

- name: Validate
run: yarn validate
3 changes: 2 additions & 1 deletion scripts/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ const valid = validate(jsonData);
if (valid) {
console.log("JSON data is valid");
} else {
console.log("JSON data is invalid. Errors:", validate.errors);
console.error("JSON data is invalid. Errors:", validate.errors);
process.exit(1);
}

0 comments on commit d3c1cd4

Please sign in to comment.