Skip to content

Commit

Permalink
feat: json validation workflow (#4)
Browse files Browse the repository at this point in the history
* feat: add validation workflow

---------

Co-authored-by: nigiri <[email protected]>
  • Loading branch information
0xkenj1 and 0xnigir1 authored Sep 10, 2024
1 parent 951452b commit 2eeba29
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/validate_json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate JSON

on:
push:
paths:
- '**/*.json'
pull_request:
paths:
- '**/*.json'

jobs:
json-validation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq

- name: Validate JSON files
run: |
find . -name "*.json" -print0 | while IFS= read -r -d '' file; do
echo "Validating $file"
if jq empty "$file"; then
echo "Valid JSON: $file"
else
echo "Invalid JSON in file: $file"
exit 1
fi
done
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ This file contains an array of Chain metadata. To add a new one, follow the foll

```json
{
"chainId": 324, //mandatory
"name": "ZKsyncERA", //mandatory
"iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png", //optional
"chainId": 324, // mandatory
"name": "ZKsyncERA", // mandatory
"iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/24091.png", // optional
"publicRpcs": [
"https://mainnet.era.zksync.io",
"https://zksync.drpc.org",
"https://zksync.meowrpc.com"
], //optional,
"explorerUrl": "https://explorer.zksync.io/", //optional
"launchDate": 1679626800, //mandatory
"explorerUrl": "https://explorer.zksync.io/", // optional
"launchDate": 1679626800, // mandatory
"chainType": "Rollup", // "Rollup" | "Validium"
"baseToken": {
"name": "Ether", //mandatory
"symbol": "ETH", //mandatory
"name": "Ether", // mandatory
"symbol": "ETH", // mandatory
"type": "native", // "native" | "erc20"
"contractAddress": null, // null if "native", address if "erc20"
"imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628", //optional
"decimals": 18 //mandatory
"imageUrl": "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png?1696501628", // optional
"decimals": 18 // mandatory
}
}
```
Expand Down

0 comments on commit 2eeba29

Please sign in to comment.