Skip to content

Automated build update #4

Automated build update

Automated build update #4

name: Notify Telegram on JSON Update
on:
push:
branches:
# - master
- feat/telegram-bot
paths:
- '**/voltage-swap-default.tokenlist.json'
jobs:
notify:
environment: TELEGRAM
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: '14'
- name: Install dependencies
run: npm install
- name: Run notify script
run: npm run notify:telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
- name: Commit changes
run: |
git add .
git push
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
# Get the current branch name
BRANCH_NAME=${GITHUB_HEAD_REF}
git fetch origin $BRANCH_NAME
git checkout $BRANCH_NAME
git add .
git commit -m "Clean new-token.json"
git rebase origin/$BRANCH_NAME
git push origin HEAD:$BRANCH_NAME
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}