chore: add Ethereum Mainnet as default for all #4
Workflow file for this run
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
name: Update Chains | |
on: | |
schedule: | |
- cron: '20 16 * * FRI' # Runs every Friday at 16:20 UTC | |
workflow_dispatch: # Can be dispatched manually | |
push: | |
branches: | |
- wallet-network-schema | |
jobs: | |
update-chains: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: yarn install | |
- name: Install ts-node | |
run: yarn global add ts-node | |
- name: Update chains data | |
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/update-chains.ts | |
- name: Commit changes | |
id: commit-changes | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
BRANCH_NAME=update-chains-$(date +%Y%m%dT%H%M%S) | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
git checkout -b $BRANCH_NAME | |
git add -A | |
if git diff-index --quiet HEAD --; then | |
echo "No changes to commit" | |
exit 0 | |
fi | |
git commit -m 'Update chains data' | |
git push origin $BRANCH_NAME | |
echo "CHANGES=true" >> $GITHUB_ENV | |
- name: Create Pull Request | |
if: env.CHANGES == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ env.BRANCH_NAME }} | |
base: dev | |
title: 'Update chains data' | |
body: 'Automated update of chains data.' |