-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08ff230
commit f926ea1
Showing
1 changed file
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] | ||
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 [email protected] | ||
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 |