diff --git a/.github/workflows/validate-tokens.yml b/.github/workflows/validate-tokens.yml index f4c7a42..040572d 100644 --- a/.github/workflows/validate-tokens.yml +++ b/.github/workflows/validate-tokens.yml @@ -3,44 +3,44 @@ name: Validate New Token Configurations on: pull_request: paths: - - 'registry/mainnet/interchain/squid.tokenlist.json' + - "registry/mainnet/interchain/squid.tokenlist.json" jobs: validate-tokens: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '16' + - uses: actions/checkout@v2 - - name: Install dependencies - run: | - npm install -g typescript - npm install ethers@5.7.2 - npm install viem - npm install axios - npm install fs - npm install @types/node + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: "16" - - name: Compile TypeScript - run: tsc validate-token-configs.ts + - name: Install dependencies + run: | + npm install -g typescript + npm install ethers@5.7.2 + npm install viem + npm install axios + npm install fs + npm install @types/node - - name: Extract and validate new tokens - run: | - DIFF=$(git diff origin/${{ github.base_ref }} -- registry/mainnet/interchain/squid.tokenlist.json | grep '^+' | grep -v '+++') - NEW_TOKENS=$(echo "$DIFF" | sed -n '/"0x/,/]/{/]/q;p}' | jq -s 'reduce .[] as $item ({}; . + ($item | fromjson))') - echo "$NEW_TOKENS" > new_tokens.json - node validate-token-configs.ts + - name: Compile TypeScript + run: tsc validate-token-configs.ts - - name: Check validation results - run: | - if [ -f validation_errors.txt ]; then - echo "Validation errors found:" - cat validation_errors.txt - exit 1 - else - echo "All new token configurations are valid." - fi + - name: Extract and validate new tokens + run: | + DIFF=$(git diff origin/${{ github.base_ref }} -- registry/mainnet/interchain/squid.tokenlist.json | grep '^+' | grep -v '+++') + NEW_TOKENS=$(echo "$DIFF" | sed -n '/"0x/,/]/{/]/q;p}' | jq -s 'reduce .[] as $item ({}; . + ($item | fromjson))') + echo "$NEW_TOKENS" > new_tokens.json + node validate-token-configs.ts + + - name: Check validation results + run: | + if [ -f validation_errors.txt ]; then + echo "Validation errors found:" + cat validation_errors.txt + exit 1 + else + echo "All new token configurations are valid." + fi