diff --git a/.github/workflows/validate_json.yaml b/.github/workflows/validate_json.yaml new file mode 100644 index 0000000..6070bee --- /dev/null +++ b/.github/workflows/validate_json.yaml @@ -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 diff --git a/README.md b/README.md index f9c4841..7a05ef8 100644 --- a/README.md +++ b/README.md @@ -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 } } ```