Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: json validation workflow #4

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading